We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Suggestion on consistent graph view

Hello,
I am using the SfChart control in a project where I need to display the dosage of medicines a person takes over time, and I would need some suggestions on how to achieve a consistent view across different dosage options.

Let's imagine we bind a C# object that is built upon this JSON:

        {
            "Minimum": 0,
            "Maximum": 100,
            "MeasurementUnit": "mg",
            "Schedule": "WeekDays",
           
"Dosages": [
                {
                    "DateFrom": "2018-05-14 11:47:55Z",
                    "DateTo": "2017-11-07 00:00:00Z",
                    "TotalDailyDosage": 30
                },
                {
                    "DateFrom": "2018-10-13 22:05:15Z",
                    "DateTo": "2018-05-14 00:00:00Z",
                    "TotalDailyDosage": 30
                }
            ]
        }

The Dosages collection will be the series of the chart, where Minimum and Maximum will be bound to the Minimum and Maximum properties of a NumericalAxis. I currently bind the TotalDailyDosage value to a DateTimeAxis, where the Minimum and Maximum are taken from the DateFrom and DateTo values.

Now the problem is that medicines can have different schedules such as every day, or 1 day each 2 weeks, or 1 day each 4 weeks. The schedule is set in the Schedule property.

In the attached screenshots, you can see different medicine info bound to the chart, but for each the Interval="30" and the IntervalType = "Days" and the view is definitely not consistent and the graph lines are sometimes very thin, if not almost invisible, and difficult to read.

Any help would be appreciated, and obviously I'm happy to provide any further information that could help me move to the right direction.

Best regards,
Alessandro

Attachment: Chart_6cb35e5f.zip

1 Reply

MP Michael Prabhu M Syncfusion Team November 28, 2018 10:48 AM UTC

Hi Alessandro, 

Greetings from Syncfusion, based on your screenshot, we suspect that you are using ColumnSeries in your application and tried to load more data in it. We would like to let you know the behavior of ColumnSeries, if we add more data to ColumnSeries obviously the width of the Column becomes too thin in order to fit all the data within the range and this is default behavior ColumnSeries. To avoid this, you have to use the AutoScrollingDelta property which is available in ChartAxis to display weekly data and scroll to see all the other data of a series. Please refer the below UG link to know more details about AutoScrollingDelta feature. 


We have prepared a sample to showcase 30 days set of data using column series and you can download the sample from the below link. 

Sample: 141158 

If you still face the issue, can you please revert us by modifying the sample based on your application along with replication procedure. This will be helpful for us to give you a better solution.  

Thanks, 
Michael 


Loader.
Live Chat Icon For mobile
Up arrow icon