KG360 Posted April 12 Report Share Posted April 12 Caspio graphs adjust the scale and the start point value to the data. I would need a script that sets the start / zero point to numerical zero (regardless of whether it's percent or currency etc). Would anyone have such a script to pass on? /KG Quote Link to comment Share on other sites More sharing options...
0 Barry Posted April 12 Report Share Posted April 12 Hello, There is an option to set the Y Axis range manually: To change the chart using JavaScript, I found this article that shows some options: https://howto.caspio.com/tech-tips-and-articles/customize-caspio-chart-datapages/ I tried to change that code and I was able to make the Chart to always start from 0 on the YAxis and it seems to work for some Charts. Maybe there is someone else that knows a better approach: <script> document.addEventListener('DataPageReady', function() { var cleaner = function(interv) { clearInterval(interv); } let interv = setInterval(() => { if(typeof Highcharts == "undefined" || !Highcharts.charts.length) return; var seriesLength = Highcharts.charts[0].series.length; var getInsideValue = Highcharts.charts[0].series[0].userOptions.data.length; cleaner(interv); Highcharts.charts[0].yAxis[0].min = 0 Highcharts.charts[0].redraw(); }) }); </script> KG360 1 Quote Link to comment Share on other sites More sharing options...
0 KG360 Posted April 15 Author Report Share Posted April 15 On 4/12/2024 at 12:16 PM, Barry said: Hello, There is an option to set the Y Axis range manually: To change the chart using JavaScript, I found this article that shows some options: https://howto.caspio.com/tech-tips-and-articles/customize-caspio-chart-datapages/ I tried to change that code and I was able to make the Chart to always start from 0 on the YAxis and it seems to work for some Charts. Maybe there is someone else that knows a better approach: <script> document.addEventListener('DataPageReady', function() { var cleaner = function(interv) { clearInterval(interv); } let interv = setInterval(() => { if(typeof Highcharts == "undefined" || !Highcharts.charts.length) return; var seriesLength = Highcharts.charts[0].series.length; var getInsideValue = Highcharts.charts[0].series[0].userOptions.data.length; cleaner(interv); Highcharts.charts[0].yAxis[0].min = 0 Highcharts.charts[0].redraw(); }) }); </script> Many thanks @Barry! The first method does not work and the option does not even show up. This may be because of how the data series are selected and the type of graph. With a wuick test of the script it does not work either. I will try again later and get back to this thread. /KG Quote Link to comment Share on other sites More sharing options...
Question
KG360
Caspio graphs adjust the scale and the start point value to the data.
I would need a script that sets the start / zero point to numerical zero (regardless of whether it's percent or currency etc).
Would anyone have such a script to pass on?
/KG
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.