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

MG-209 - Remove area linechart #252

Merged
merged 2 commits into from
Mar 21, 2024
Merged
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 @@ -48,11 +48,6 @@ func CreateItem() []Item {
Content: "This is a range chart",
Widget: "stackedLineChart",
},
{
Title: "Area Line Chart",
Content: "This is a stacked area line chart",
Widget: "areaLineChart",
},
{
Title: "Temperature Gauge",
Content: "This is an analogue temperature gauge",
Expand Down
98 changes: 0 additions & 98 deletions ui/web/static/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,103 +102,6 @@ class AlarmsTable extends Chart {
}
}

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

#generateScript() {
return `
var areaLineChart = echarts.init(document.getElementById("${this.ID}"));
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
title: {
text: '${this.chartData.title}',
},
legend: {
data: ['voltage', 'current', 'temperature', 'pressue']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['thing1', 'thing2', 'thing3', 'thing4', 'thing5', 'thing6', 'thing7'],
name: '${this.chartData.xAxisLabel}',
nameLocation: 'middle',
nameGap: 25,
}
],
yAxis: [
{
type: 'value',
name: '${this.chartData.yAxisLabel}',
nameLocation: 'middle',
nameGap: 35,
}
],
series: [
{
name: 'voltage',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: 'current',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: 'temperature',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [150, 232, 201, 154, 190, 330, 410]
},
{
name: 'pressure',
type: 'line',
stack: 'Total',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [320, 332, 301, 334, 390, 330, 320]
},
]
};

areaLineChart.setOption(option);`;
}
}

class TimeSeriesBarChart extends Echart {
constructor(chartData, widgetID) {
super(widgetID, chartData);
Expand Down Expand Up @@ -1847,7 +1750,6 @@ class ValueCard extends Chart {
const chartTypes = {
alarmCount: AlarmCount,
alarmsTable: AlarmsTable,
areaLineChart: AreaLineChart,
timeSeriesBarChart: TimeSeriesBarChart,
donutChart: DonutChart,
doubleBarChart: DoubleBarChart,
Expand Down
262 changes: 0 additions & 262 deletions ui/web/templates/charts/arealinechartmodal.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 @@ -103,7 +103,6 @@ <h5 id="widgetsCanvasLabel">Widgets</h5>
{{ template "speedgaugemodal" . }}
{{ template "tempgaugemodal" . }}
{{ template "stackedlinechartmodal" . }}
{{ template "arealinechartmodal" . }}
{{ template "horizontalbarchartmodal" . }}
{{ template "dynamicdatachartmodal" . }}
{{ template "doublebarchartmodal" . }}
Expand Down
Loading