This is a migrated thread and some comments may be shown as answers.

Expression for chart label

6 Answers 276 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mary
Top achievements
Rank 1
Mary asked on 14 Sep 2018, 05:34 AM

Good afternoon,

I purchased and loaded Reporting today to produce some reports based on our current web application. The first chart I need has an x-axis comprising seconds from the start of a session. The chart shows metrics from an exercise session. I need to change the second values to minutes, but not lose any of the points.

In my web page I have used the following in the markup:

<XAxis>
                <LabelsAppearance >
                    <ClientTemplate>
                    #= kendo.format(\'{0:N0}\', value / 60)#
                            
                    </ClientTemplate>
                </LabelsAppearance>
                <TitleAppearance Text="Minutes" />

My question is how to achieve this in Reporting? I can find the format builder, but this does not seem to allow expressions.

 

Thank you

6 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 18 Sep 2018, 04:08 PM
Hi Mary,

In the Graph you can use Bindings property of the corresponding Coordinate System to modify run time the exposed Axes properties based on Expressions. I have attached a screenshot for clarity.
If you need more specific advices I suggest to open a Support ticket and elaborate on the exact scenario. 

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mary
Top achievements
Rank 1
answered on 26 Sep 2018, 01:39 AM

Thank you Todor - have just got back to this. 

My problem is that every time I put any sort of expression into the bindings all I get back is value 1 repeated. As soon as the binding is removed it goes back to the display of EntryID (which is one entry per second). I have 2 coordinate systems in play - have tried setting one or the other or both and get the same result.

An example is setting the expression for the LabelFormat to something as simple as =Format('X:{0}', Fields.EntryID) - this yields an X:1 for the labels (3 of them along the x axis). Not sure if this is your bug or my bug... I may just be missing something - if you could give an example of formatting these values to make them appear as minutes that would be helpful

0
Todor
Telerik team
answered on 28 Sep 2018, 02:37 PM
Hello Mary,

The LabelFormat of the Axis can take as an argument only aggregate function. When using Fields.EntryID it falls back to First(Fields.EntryID), hence the observed behavior.

The label of the Category scale can be formatted from the corresponding CategoryGroup -> Label property. Check the attached screenshot for clearance. In this case it is not necessary to use Bindings as the property Value can be directly set with Expressions.

If the problem persists, consider opening a support ticket and attaching a sample report definition for local investigation.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mary
Top achievements
Rank 1
answered on 30 Sep 2018, 05:01 AM

If I could figure out how to open a support ticket I would - your suggestion does nothing to my report. I have the entryID numbers showing correctly but need to divide them by 60 (or even 300) to place labels as minutes. Surely this is basic stuff!!!! Even just using your = Format("X:{0}",Fields.EntryID) expression for the label in the category group did not change the labels at all. and if you are providing an example could it least have a formula in there to do what I am attempting.

I paid a lot for this product and will be asking for a refund and looking elsewhere shortly.

0
Mary
Top achievements
Rank 1
answered on 30 Sep 2018, 05:05 AM
here is a screen shot
0
Mary
Top achievements
Rank 1
answered on 01 Oct 2018, 03:29 AM
Finally got this working based on https://www.telerik.com/forums/label-of-category-axe
Tags
General Discussions
Asked by
Mary
Top achievements
Rank 1
Answers by
Todor
Telerik team
Mary
Top achievements
Rank 1
Share this question
or