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

RemoteDataBinding with unknown number of lines

4 Answers 9 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Stéphane
Top achievements
Rank 1
Stéphane asked on 15 Oct 2020, 01:04 PM

I'm trying to write a graph where the user can configure what data she wants to see.

I implemented a first version based on the remote data binding demo that uses a model describing all data point of the given "column":

Html.KendoEscapeTemplate(Html.Kendo().Chart<Peppermint.ApplicationCore.ViewModel.FiscalYearSerieDataPointVM>() ...

 

With the VM being:

public class FiscalYearSerieDataPointVM
{
    public int MonthNumber { get; set; }
    public decimal CurrentFiscalYearDataPoint { get; set; }
    public decimal? PreviousFiscalYearDataPoint { get; set; }
}

 

That, obviously, will not work when the char is configured by the user and could have any number of different lines. It's also not very practical to generate data in a "vertical" format because I have to run all queries first and then pivot the result into a collection of FiscalYearSerieDataPointVM

How am I supposed to work around that problem? Am I supposed to use a dynamic object instead of a ViewModel?

4 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 20 Oct 2020, 08:57 AM

Hi Stephane,

Thank you for the information so far. However, it is not clear to me what options exactly the user will modify. Are they allowed to modify the data, or to request specific portions of the data? Is the problem related to the specification of several series? Is the chart type set to "line" or anything else?

It would be very helpful if you could share more details on the case and perhaps 1 or 2 actual scenarios that you are willing to overcome. So that I can think of suggestions related to your specific requirements.

Thank you for your cooperation in advance.

 

Kind regards,
Tsvetomir
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

0
Stéphane
Top achievements
Rank 1
answered on 20 Oct 2020, 09:04 AM

Hello Tsvetomir,

We're designing a dashboard for a financial software product. The user will be able to create graphs for a given fiscal year by selecting things like result per month, income, specific account performance, analytical account performances, etc.

Basically, users will be presented with a list of possible data type, each one could have a specific configuration. The result will be calculated by the serevr and displayed in a single grid (users whould then be able to add more grids to teh dashboard as they see fit).

 

I hope that answers your questions but, but myself, I think I got my answer: I have asked your support and got a link that helped me solve that problem:

https://github.com/telerik/ui-for-aspnet-mvc-examples/tree/master/chart/dynamic-series

Thank you again,

Stephane

 

0
Stéphane
Top achievements
Rank 1
answered on 20 Oct 2020, 09:06 AM

I seem to have forgotten to answer a couple of your questions:

- In my case, the categories will be fixed (one per month)

- Graphs types will be defined by the nature of the data: results will be display as stacked bars while performance will be displayed as lines, for instance.

0
Tsvetomir
Telerik team
answered on 20 Oct 2020, 02:22 PM

Hi Stephane,

Thank you for taking the time to share all the relevant details around the scenario you are willing to achieve. It is appreciated. 

Indeed, the example that you have shared should be suitable for resolving the case. If you have other queries, you could paste them in the other ticket as leading discussions on two threads might lead to miscommunication.

 

Kind regards,
Tsvetomir
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
Chart
Asked by
Stéphane
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Stéphane
Top achievements
Rank 1
Share this question
or