Commit e98b1aa4 authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - line chart modifications

parent 3e74be8c
......@@ -48,7 +48,8 @@ function set_data(elementObject, numberOfCharts, callback) {
setTimeout(function() {
const defaultColors = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#a1887f', '#ffb980', '#2ec7c9','#b6a2de','#5ab1ef', '#d87a80', '#ea7ccc'];
// lightcolors = ['#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f'];
const defaultColors = ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928'];;
let options;
let rawData = elementObject.attr('raw') ? JSON.parse(elementObject.attr('raw')) : null;
......
......@@ -32,7 +32,7 @@
class Config
{
public $methodAllocation = [
'Limitless::Chart' => 'chart'
'Limitless::LineChart' => 'lineChart'
];
public $assetAllocation;
......@@ -40,7 +40,7 @@
public function __construct()
{
$this->assetAllocation = [
'Limitless::Chart' => [
'Limitless::LineChart' => [
'Attachments/linechart.init.js',
secure_url('/ceetrox/sidekick/resource/public/Webdesigns/design-limitless/Template/global_assets/js/plugins/visualization/echarts/echarts.min.js'),
]
......@@ -50,10 +50,10 @@
/*
|--------------------------------------------------------------------------------------------
| Method "chart"
| Method "lineChart"
|--------------------------------------------------------------------------------------------
*/
public function chart($parameters)
public function lineChart($parameters)
{
return View('Limitless::Linechart.Chart')
->withCharts($parameters['charts'] ?? 1)
......
......@@ -17,7 +17,7 @@
$dataArray[] = rand(1,100);
}
$data['data'] = $dataArray;
$data['index'] = 0; //rand(0,1);
$data['index'] = 0; //rand(0,1); on what chart index to add.
$seriesData[] = $data;
}
......@@ -42,27 +42,15 @@
@endphp
@Limitless::CardStart(['title' => "Description", 'icon' => 'icon-info22' ] )
@Limitless::Chart([
'titles' => 'Sample 1',
'charts' => 1,
'colors' => ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#a1887f', '#ffb980', '#2ec7c9','#b6a2de','#5ab1ef', '#d87a80', '#ea7ccc'],
'point-values' => true,
'boundary-gap' => true,
'inverted' => false,
'data-zoom' => true,
'stacked' => false,
'animation-duration' => 500,
'y-axis-label-value-format' => '{value} users',
'mark-line' => 'average',
@Limitless::CardStart(['title' => "Basic Setup", 'icon' => 'icon-info22' ] )
@Limitless::LineChart([
'categories' => $categories,
'series' => $seriesData,
])
@Limitless::CardStop
@Limitless::CardStart(['title' => "Chart 2 (raw)", 'icon' => 'icon-info22' ] )
@Limitless::Chart([
@Limitless::LineChart([
'raw' => $rawData
])
@Limitless::CardStop
......
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