Closed Joshlete closed 11 months ago
as the docs suggest, while using ->setJsonConfig
, you must use dot (.) notation to add nested keys, no need to pass multi array or json_encode.
Instead of passing an array of multiple arrays you should use like this:
->setJsonConfig([
'fill.type' => 'gradient',
'fill.gradient.shade' => '',
'fill.gradient.shadeIntensity' => 0.8,
'fill.gradient.opacityFrom' => 0.6,
'fill.gradient.opacityTo' => 0.1,
'tooltip.enabled' => false,
'xaxis.show' => true,
'xaxis.lines.show' => false,
'xaxis.labels.show' => false,
'xaxis.stroke.width' => 0,
'xaxis.axisBorder.show' => false,
'chart.toolbar.show' => false,
'chart.height' => 90,
'markers.colors' => 'transparent',
'markers.strokeColors' => 'transparent',
'grid.show' => false,
])
hope it will help you
$chart = (new LineChartModel())
->addPoint(10, 30)
->addPoint(20, 40)
->addPoint(30, 50)
->setJsonConfig([
'xaxis.show' => false,
'title.text' => 'Basic Line Chart',
'title.align' => 'left',
'chart.background' => '#f0f0f0'
]);
That is helpful advice, thank you. Unfortunately, it is still not working. xaxis still shows up, background doesn't change, I can't get a single thing in the setJsonConfig() function to work.
In v3.0.0, the setJsonConfig method is no longer documented, but is still included in the code.
However, its use does not affect the appearance of the chart. Has anything changed? I want to change min/max of the Y-Axis
Yeah, it's not working for me either.
This will be fixed when #108 is merged
I am a beginner to laravel, and I need to customize the graph to have annotation. This is in my livewire component:
And I return is like this:
This is in the blade file:
But this is what I am getting:
Ive tried by using json_encode and without using it. I've tried to simplify it as much as possible. But I am not getting any change from using setJsonConfig(). Am I doing something wrong?