
Hello Experts,
I am writing a bus chart from scratch by making use of the Microsoft.dynamics.nav.client.business chart add-in and displaying this as a card part in a page for now.
I got it to work where I have my x-axis (time) and y-axis (weight) plus 3 other additional measures. The problem is the weights measure for each time are only a few points away from ea other. e.g., Weight ranges from 506,511,514,517,522 and 533. Is there any way for me to control the y-axis interval or the weight interval in the y-axis. Right now, it shows interval of 100 when datatype=decimal. This doesn't help show the graph nicely. It gives me almost a straight line. Any thoughts on how I can control the interval? I.e., rather than 500,600,700 in the y-axis, I can show 500,502,504,506, etcc.
Below is my code to create the bus chart from scratch.
WITH BusChartBuff DO BEGIN
Initialize; //function defined in BusChartBuf Table; Used to initialize Dotnet Variable
//defining Y-axis measure (Name, Data Type and Chart Type) to the bus chart
//other chart types: point, bubble, line, stepline, etcc
AddMeasure('Weight',1,"Data Type"::Decimal,"Chart Type"::Point);
AddMeasure('Target Weight',1,"Data Type"::Decimal,"Chart Type"::Line);
AddMeasure('High Level Weight',1,"Data Type"::Decimal,"Chart Type"::Line);
AddMeasure('Low Level Weight',1,"Data Type"::Decimal,"Chart Type"::Line);
//defining X-axis measure (Name and Data type) to the Business Chart;
SetXAxis('Recorded Time',"Data Type"::String);
//Filtering Query
QryBatchWt.SETRANGE(QryBatchWt.Document_No,DocumentNo);
i := 0;
QryBatchWt.OPEN;
WHILE QryBatchWt.READ DO BEGIN
i += 1;
BusChartBuff.AddColumn(FORMAT(QryBatchWt.Defect_Recorded_Time,0,'<Hours12>:<Minutes,2><AM/PM>')); //x-axis value
//Setvalue function required measure name becase we can specify multiple measures on Y-Axis
//The measure name should MATCH correctly with the name specified in the AddMeasure function above
SetValue('Weight',i - 1,QryBatchWt.Weight); //Y axis value
SetValue('Target Weight',i - 1,QryBatchWt.TargetWt); //Y axis value
SetValue('High Level Weight',i - 1,QryBatchWt.HLWt); //Y axis value
SetValue('Low Level Weight',i - 1,QryBatchWt.LLWt); //Y axis value
END;
QryBatchWt.CLOSE; //Close Query
END;
*This post is locked for comments
I have the same question (0)HI Nav Developers,
Just an update, it's impossible to dynamically change the interval in Nav. The only way is we create the chart control from scratch. :(