SfChart Line and Scatter series on a single axis

Hello,

I am experimenting with SfChart and I am trying to display chart with transactions (price chart with buys and sells highlighted). I figured using line series for prices in combination with scatter series for buys/sells (with custom data marker) might be the best way to achieve it. However, the scatter series does not respect the primary and secondary axis as I would like. Based on documentation, I'd expect it is the default behavior when using multiple series in a single chart.

This is my code behind:


This is my view content:


And this is the resulting chart:


I'd expect to have the blue dots from scatter plot on line data points with indexes 3 and 6 (values 25 and 64 in data markers). But they do not seem to respect the X binding and are just displayed on a first and second X location. Y binding works just fine. I tried non-fast version of the series as well, didn

How do I make my scatter series respect their X locations? Is it possible?


4 Replies 1 reply marked as answer

OS Ondrej Slimak August 26, 2021 03:26 PM UTC

I have prepared a minimal sample with my problem.


Attachment: ChartMinimal_5c33fb5c.zip


YP Yuvaraj Palanisamy Syncfusion Team August 28, 2021 03:04 AM UTC

Hi Ondrej Slimak, 

Greetings from Syncfusion. 

We have analyzed your query and we would like to inform that the reported problem “” has been resolved by using DateTimeAxis instead of DateTimeCategoryAxis. DateTimeCategoryAxis is an index based. Please find the code example below. 

CodeSnippet
<sfc:SfChart.PrimaryAxis> 
    <sfc:DateTimeAxis ShowMajorGridLines="false"> 
        <sfc:DateTimeAxis.AxisLineStyle> 
            <sfc:ChartLineStyle StrokeColor="White" /> 
        </sfc:DateTimeAxis.AxisLineStyle> 
        <sfc:DateTimeAxis.LabelStyle> 
            <sfc:ChartAxisLabelStyle LabelFormat="MMM" /> 
        </sfc:DateTimeAxis.LabelStyle> 
    </sfc:DateTimeAxis
</sfc:SfChart.PrimaryAxis> 

Output
 

For more details, please refer the below link. 

Regards, 
Yuvaraj. 


Marked as answer

OS Ondrej Slimak August 29, 2021 01:41 PM UTC

I confirm this solved my issue. Thank you for the help.



YP Yuvaraj Palanisamy Syncfusion Team August 30, 2021 07:48 AM UTC

Hi Ondrej Slimak,  
 
Thank you for your update. 
 
Please let us know if you have any concern.  
 
Regards,  
Yuvaraj. 


Loader.
Up arrow icon