Commit b1e2d700 authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - added linechart samples (for raw)

parent 8d66e343
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
public function __construct() public function __construct()
{ {
$this->assetAllocation = [ $this->assetAllocation = [
'Limitless::LineChart' => [ 'Limitless::BarChart' => [
'Attachments/barchart.init.js', 'Attachments/barchart.init.js',
secure_url('/ceetrox/sidekick/resource/public/Webdesigns/design-limitless/Template/global_assets/js/plugins/visualization/echarts/echarts.min.js'), secure_url('/ceetrox/sidekick/resource/public/Webdesigns/design-limitless/Template/global_assets/js/plugins/visualization/echarts/echarts.min.js'),
] ]
......
...@@ -25,25 +25,112 @@ ...@@ -25,25 +25,112 @@
$multichartSeriesData[] = $multiData; $multichartSeriesData[] = $multiData;
} }
// json string data should be valid else it will return null // json string data should be valid else it will return null
$rawData = '{ $rawData = '{
"color":["#8dd3c7", "#ffffb3"], "color":[
"#8dd3c7",
"#ffffb3"
],
"textStyle":{ "textStyle":{
"color":"#fff" "color":"#fff"
},
"title":{
"text":"Distribution of Electricity",
"subtext":"Fake Data",
"textStyle": {
"color": "#fff"
}
},
"tooltip":{
"trigger":"axis",
"axisPointer":{
"type":"cross"
}
},
"toolbox":{
"show":true,
"feature":{
"saveAsImage":{
}
}
}, },
"xAxis":{ "xAxis":{
"type":"category", "type":"category",
"boundaryGap":false, "boundaryGap":false,
"data":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"] "data":["00:00","01:15","02:30","03:45","05:00","06:15","07:30","08:45","10:00","11:15","12:30","13:45","15:00","16:15","17:30","18:45","20:00","21:15","22:30","23:45"]
}, },
"yAxis":{ "yAxis":{
"type":"value" "type":"value",
"axisLabel":{
"formatter":"{value} W"
},
"axisPointer":{
"snap":true
}
},
"visualMap":{
"show":false,
"dimension":0,
"pieces":[
{
"lte":6,
"color":"green"
},
{
"gt":6,
"lte":8,
"color":"red"
},
{
"gt":8,
"lte":14,
"color":"green"
},
{
"gt":14,
"lte":17,
"color":"red"
},
{
"gt":17,
"color":"green"
}
]
}, },
"series":[ "series":[
{ {
"data":[820,932,901,934,1290,1330,1320], "name":"Electricity",
"type":"line", "type":"line",
"areaStyle":{} "smooth":true,
"data":[300,280,250,260,270,300,550,500,400,390,380,390,400,500,600,750,800,700,600,400],
"markArea":{
"itemStyle":{
"color":"rgba(255, 173, 177, 0.4)"
},
"data":[
[
{
"name":"Morning Peak",
"xAxis":"07:30"
},
{
"xAxis":"10:00"
}
],
[
{
"name":"Evening Peak",
"xAxis":"17:30"
},
{
"xAxis":"21:15"
}
]
]
}
} }
] ]
}'; }';
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
@if($markLine != null) mark-line="{{ $markLine }}" @endif @if($markLine != null) mark-line="{{ $markLine }}" @endif
categories="{{ json_encode($categories) }}" categories="{{ json_encode($categories) }}"
series="{{ json_encode($series) }}" series="{{ json_encode($series) }}"
raw="{{ $raw }}" raw="{{ json_encode(json_decode($raw)) }}"
> >
</div> </div>
</div> </div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment