You must be logged in to post your query.
Home › Forums › Chart Support › Is there a Bar100
Tagged: Bar
I am looking for a Bar100, i.e works like Bar but the the y-axis goes from 1-100. So you can hover over a bar an it shows its actual value on the Bar, whist having the y-axis always show the percentage. So this means with one chart the viewer can see the data reals values an expressed as a percentage.
To put it another way its like StackedBar100 but I don’t have multiple sets of data and I dont want the bars to go completely from 0 -100.
I hope that is clear.
@paultaylor
You can use labelFormatter in order to modify labels of axisY. Please, take a look at this jsFiddle.
—- Bivek Singh
Thankyou that is what i required.
Actually I was trying to implement it more like done on this page https://canvasjs.com/docs/charts/chart-options/axisy/label-formatter/ but having an issue since label-formatter is not in double quotes. Is it valid json for the value of label-fomatter to not be double quotes, or is this output not json.
@paultaylor,
No, defining function as the value for any key is not valid JSON. For further details, you can refer these links: [1]. https://stackoverflow.com/questions/2001449/is-it-valid-to-define-functions-in-json-results [2]. http://www.json.org/
Thanks, I sort of worked this out but I am finding it a bit difficult to differentiate between json and javascript data. I assume in the jsfiddle the data: [] part is json and the rest javascript ? In the examples on https://canvasjs.com/docs/charts/chart-options/axisy/label-formatter/ are you doing it incorrectly then, or is that all pure javascript rather than json ?
JavaScript object is used as an option for chart. There is a difference between JSON and javaScript object literal. To know about the differences, you can check out these stackoverflow threads: [1]. https://stackoverflow.com/questions/3975859/what-are-the-differences-between-json-and-javascript-object [2]. https://stackoverflow.com/questions/2904131/what-is-the-difference-between-json-and-object-literal-notation [3]. https://stackoverflow.com/questions/8294088/javascript-object-vs-json
okay, thanks I get the difference but Im not clear do you use JSON inside the data part or is it all just Javascript ?
It is just JavaScript object.
You must be logged in to reply to this topic. Login/Register