Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

MG-211 - Remove double bar chart #228

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions ui/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ func CreateItem() []Item {
Content: "This is a horizontal bar chart",
Widget: "horizontalBarChart",
},
{
Title: "Double Bar Chart",
Content: "This is a double bar chart",
Widget: "doubleBarChart",
},
{
Title: "Multiple Line Chart",
Content: "This is a multiple line chart",
Expand Down
92 changes: 0 additions & 92 deletions ui/web/static/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,97 +300,6 @@ class DonutChart extends Echart {
}
}

class DoubleBarChart extends Echart {
constructor(chartData, widgetID) {
super(widgetID, chartData);
this.Script = this.#generateScript();
}

#generateScript() {
let seriesName = this.chartData.seriesName.split(",");
return `
var doubleBarChart = echarts.init(document.getElementById("${this.ID}"));
var option = {
title: {
text: '${this.chartData.title}',
left: 'left'
},
tooltip: {
trigger: 'axis'
},
legend: {
show: true,

},
toolbox: {
show: true,
feature: {
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
saveAsImage: { show: true }
}
},
calculable: true,
xAxis: [
{
type: 'category',
// prettier-ignore
data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
name: '${this.chartData.xAxisLabel}',
nameLocation: 'middle',
nameGap: 30
}
],
yAxis: [
{
type: 'value',
name: '${this.chartData.yAxisLabel}',
nameLocation: 'middle',
nameGap: 40
}
],
series: [
{
name: '${seriesName[0]}',
type: 'bar',
data: [
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
],
markPoint: {
data: [
{ type: 'max', name: 'Max' },
{ type: 'min', name: 'Min' }
]
},
markLine: {
data: [{ type: 'average', name: 'Avg' }]
}
},
{
name: '${seriesName[1]}',
type: 'bar',
data: [
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
],
markPoint: {
data: [
{ name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
{ name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
]
},
markLine: {
data: [{ type: 'average', name: 'Avg' }]
}
}
]
};

doubleBarChart.setOption(option);
`;
}
}

class DynamicDataChart extends Echart {
constructor(chartData, widgetID) {
super(widgetID, chartData);
Expand Down Expand Up @@ -1884,7 +1793,6 @@ const chartTypes = {
areaLineChart: AreaLineChart,
timeSeriesBarChart: TimeSeriesBarChart,
donutChart: DonutChart,
doubleBarChart: DoubleBarChart,
dynamicDataChart: DynamicDataChart,
entitiesTable: EntitiesTable,
entityCount: EntityCount,
Expand Down
272 changes: 0 additions & 272 deletions ui/web/templates/charts/doublebarchartmodal.html

This file was deleted.

1 change: 0 additions & 1 deletion ui/web/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ <h5 id="widgetsCanvasLabel">Widgets</h5>
{{ template "arealinechartmodal" . }}
{{ template "horizontalbarchartmodal" . }}
{{ template "dynamicdatachartmodal" . }}
{{ template "doublebarchartmodal" . }}
{{ template "multiplelinechartmodal" . }}
{{ template "stepchartmodal" . }}
{{ template "multigaugemodal" . }}
Expand Down
Loading