Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Business Chart Y-axis interval

Posted on by 5,124

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

  • Verified answer
    mbr Profile Picture
    mbr 5,124 on at
    RE: Business Chart Y-axis interval

    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. :(

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans