web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Business Chart Y-axis interval

(0) ShareShare
ReportReport
Posted on by 5,136

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)
  • Verified answer
    mbr Profile Picture
    5,136 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans