I'm using the DataChart (in Javascript) to show the percentages of the costs of bad parts. This is curently looking like this:
Here I set the maximumValue to 8. If I don't do that, the chart stops at the highest number. I want some more white space above it. Is there a way to do this more dinamically? I don't know what the highest number here will be and I would like it to be something like "highestNumber + 1". Is this possible?
Also I want to remove the horizontally gridlines. How can I do that?
And is it possible to add labels on top of the columns llike this:
Where the numbers in the labels are also the percentages values used in this chart. Can this be done?
Hello Ronny,
1. You can use the getActualMaximumValue method to retrieve the actual maximum value of the axis. Notice that this works for numeric and date time axes only.
2. For the horizontal and vertical grid lines you can use both majorStroke or majorStrokeThickness in order to hide them.
3. For the last requirement with the label on top of the columns, you can see the suggested answer of one of our engineers.
if you have further questions, please contact us again.
Hello
The solution for the gridlines work.
How can I properly use the getActualMaximumValue method (I'm new at Infragistics)?
I have tried this:
var maxAxes = $("#diagramTop10Cost").igDataChart("getActualMaximumValue", "yAxis");
This is before my chart is build up:
CreateChart("#diagramTop10Cost", "column", "Top 10 cost Ok/Nok € %");
function CreateChart(chartID, seriesType, chartTitle) { $(chartID).igDataChart({ width: "80%", height: "300px", title: chartTitle, horizontalZoomable: false, verticalZoomable: false, dataSource: dataTop10Costs, axes: [ { name: "xAxis", type: "categoryX", label: "Reason", gap: 0.8, labelTextStyle: "8pt Verdana", majorStrokeThickness: 0 }, { name: "yAxis", type: "numericY", minimumValue: 0, maximumValue: maxAxes+1, labelTextStyle: "8pt Verdana" } ], series: [ CreateSeries(seriesType, "Percentage") ] }); }
I'm guessing this isn't the proper way?
Sounds great!
If you have any other questions, please contact us again.
This helped! Thanks!
This method invocation should happen after the chart is rendered. Sorry about my misunderstanding. You've told that you want to know what is the maximum yAxis value before the chart is rendered. The approach I can propose is the process your data and retrieve the maximum value that will represents the yAxis and than build the chart by passing the that value.