Jump to content

Formating a chart


SergioFeitoza

Recommended Posts

Hi. I need your help.

I have some doubts about formatting my KendoUI chart. Most are about formatting. I tried to  show them in the figure attached. The codes I am using are in the next lines. Main doubt is how to format the horizontal axis. I do not find the right properties to use.

 

THE CODES I AM USING

  a)       To insert the records in a dataset

uniMainModule.cdsTop.AppendRecord([distM, RdynD].V[0], RdynD.V[1],RdynD.V[2],moduF,  0  , 0  , 0   ,ncest]);

 

bb)      CODE TO FIX DECIMALS

ChartSeries.Values['Fmod'] := 'serFmod';

ChartProperties.Values['valueAxis'] := '{labels: {format: "#,0.0"}}';             // vertical  axis  one decimal

ChartProperties.Values['tooltip'] := '{visible: true, format: "#,0.000"}';               // points   3 decimals

ChartSeriesDefaults := 'labels: {visible: true, position: "insideEnd", format: "#,0.00"}';

/////////////////////////////////////////////

procedure TfResults.dbChartTopAjaxEvent(Sender: TComponent; EventName: string;
  Params: TUniStrings);
begin
  if EventName = 'ClickSeries' then
    ShowMessage('name = '+Params.Values['name']+'</br>'+
                'category = '+Params.Values['category']+'</br>'+
                'value = '+Params.Values['value'] );
end;

FormatChart.thumb.png.1da05200b21da210d35638a84955173d.png

Link to comment
Share on other sites

Sherzod   . The test case you request is in this post and attached.

http://forums.unigui.com/index.php?/topic/12970-change-label-of-unichart/&_fromLogin=1

If you click in the  Graph.bmp you will see in the horizontal axis exactly what I need to obtain . It is generated with the test case ChartSample01.zip also attached.

I need in the horizontal axis a float number with just one decimal . I tried to find a code to do this but not found.

I think this is to be done with ClientEvents > ExtEvents   or ClientEvents > UniEvents but I do not know how

What I do not understand also is that  I can not find anywhere in the code where the  number of decimals of the horizontal is fixed. For example if I want to change from 1 to 2decimals.In the code Idid not find any event doing this but the result show it

OneDecimal.png

ChartSample01.zip

Link to comment
Share on other sites

2 hours ago, SergioFeitoza said:

The test case you request is in this post and attached.

Thanks for the testcase.

2 hours ago, SergioFeitoza said:

I need in the horizontal axis a float number with just one decimal . I tried to find a code to do this but not found.

Sorry, do you want to remove the fractional part!?

Link to comment
Share on other sites

10 hours ago, Sherzod said:

Thanks for the testcase.

Sorry, do you want to remove the fractional part!?

No. I do not want to remove the fractional part (like   2200,    ).

I want to know how to chage from one decimal ( one number after the comma like   2200,0  ) to two decimals   (like 2200,00 )

This is easy to do in VCL with TNumericField(FieldByName('distM')).DisplayFormat :=  '#,0.00';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...