Stock Chart doesn't seem to work with SfDataManager in ODataV4Adaptor mode

1 issue, 1 question

Issue: I have a stock chart that works if I separately retrieve data and return in a List dataset, but if I attempt to bind it directly to SfDataManager, it always fails.

Question: If it were working, does the binding to SfDataManager cause the SfStockChart to retrieve just the time-period of data being requested by the current configuration of the chart, or does it always retrieve ALL, then just display according to current settings. i.e. if there is 20 years of data, and current config is just for past month, will the chart retrieve all 20 years, or just past month?

Current (Failing) configuration

Here is the config of the SfStickChart and SfDataManager:

 <SfStockChart @ref="sc" Height="600" >
        <SfDataManager Url="odata/Instruments(10153)/InstHistDailies" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
         <StockChartPrimaryXAxis Title="Date" ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime"></StockChartPrimaryXAxis>
        <StockChartPeriods>
            <StockChartPeriod IntervalType=RangeIntervalType.Days Interval="3" Text='3d'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Weeks Interval="1" Text='1w'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Weeks Interval="2" Text='2w'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Months Interval="1" Text='1m'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Months Interval="3" Text='3m' Selected="true"></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Months Interval="6" Text='6m'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Years Interval="1" Text='1y'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Years Interval="2" Text='2y'></StockChartPeriod>
            <StockChartPeriod IntervalType=RangeIntervalType.Years Interval="5" Text='5y'></StockChartPeriod>
        </StockChartPeriods>
        <StockChartSeriesCollection>
            <StockChartSeries Type="ChartSeriesType.Candle" XName="Date" YName="Close" High="High" Low="Low" Open="Open" Close="Close" Volume="Volume" Query="ChartQuery"></StockChartSeries>
            @*<StockChartSeries Query="ChartQuery" Type="ChartSeriesType.Candle" XName="Date" YName="Close"></StockChartSeries>*@
        </StockChartSeriesCollection>
    </SfStockChart>


Here is a sample of the data being returned by the OData Endpoint (odata/Instruments(10153)/InstHistDailies):

{
"@odata.context": "https://localhost:5001/odata/$metadata#InstHistDailies",
"value": [
{
"Instrument": 10153,
"Date": "2011-05-09T00:00:00+10:00",
"Open": 0.2000000000,
"Close": 0.2300000000,
"High": 0.2300000000,
"Low": 0.2000000000,
"Volume": 790000.0000000000,
"Value": 172400.0000000000,
"AdjClose": null,
"Adjustment": null,
"Source": 6,
"LastModified": "2021-11-24T17:57:15.427+11:00",
"LastModifiedBy": -1,
"Code": "AHK"
},
{
"Instrument": 10153,
"Date": "2011-05-10T00:00:00+10:00",
"Open": 0.2050000000,
"Close": 0.2000000000,
"High": 0.2100000000,
"Low": 0.2000000000,
"Volume": 208970.0000000000,
"Value": 42918.8500000000,
"AdjClose": null,
"Adjustment": null,
"Source": 6,
"LastModified": "2021-11-24T17:57:15.427+11:00",
"LastModifiedBy": -1,
"Code": "AHK"
},
{
"Instrument": 10153,
"Date": "2011-05-11T00:00:00+10:00",
"Open": 0.2000000000,
"Close": 0.2050000000,
"High": 0.2050000000,
"Low": 0.2000000000,
"Volume": 97500.0000000000,
"Value": 19507.3500000000,
"AdjClose": null,
"Adjustment": null,
"Source": 6,
"LastModified": "2021-11-24T17:57:15.427+11:00",
"LastModifiedBy": -1,
"Code": "AHK"
}
]
}

Please advise.


10 Replies

DG Durga Gopalakrishnan Syncfusion Team May 25, 2022 03:00 PM UTC

Hi Phil,


Greetings from Syncfusion.


# 1 : I attempt to bind it directly to SfDataManager, it always fails


We have considered your reported scenario as bug and logged a defect report for this issue. This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 7th June 2022. We appreciate your patience until then. You can keep track of the bug from the below feedback link.


Feedback Link : https://www.syncfusion.com/feedback/35190/odataadaptor-is-not-working-with-stockchart


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.


# 2 : to retrieve just the time-period of data being requested by the current configuration of the chart, or does it always retrieve ALL, then just display according to current settings.


You can use Query to get required number of data points from URL. Please check with the below documentation link.


UG : https://blazor.syncfusion.com/documentation/chart/working-with-data#sending-additional-parameters-to-the-server


Please revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



DG Durga Gopalakrishnan Syncfusion Team June 14, 2022 01:29 PM UTC

Hi Phil,


We are working on the reported issue and we will include this fix in our upcoming weekly patch release which is scheduled to be rolled out on 28th June 2022. We appreciate your patience until then.


Regards,

Durga Gopalakrishnan.



DG Durga Gopalakrishnan Syncfusion Team July 19, 2022 02:44 PM UTC

Hi Phil,


We are glad to announce that our v20.2.0.39 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor.Charts NuGet package.


NuGet Package : https://www.nuget.org/packages/Syncfusion.Blazor.Charts/


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Durga Gopalakrishnan.



YA Yann October 23, 2022 05:31 AM UTC

Hi, I tested the version 20.3.0.50 uncess with this configuration:

<SfStockChart Title="Test">
<SfDataManager Url="https://localhost:7253/Ohlc" CrossDomain="true" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
<StockChartSeriesCollection>
<StockChartSeries Type="ChartSeriesType.Candle" XName="Date" YName="Close" High="High" Low="Low" Open="Open" Close="Close" Volume="Volume" Name="Candles">
</StockChartSeries>
</StockChartSeriesCollection>
</SfStockChart>

I discovered the code in Syncfusion.Blazor.Charts.Internal.FinancialBaseRenderer.ProcessJObjectData fails while deserializing json because non-mandatory parameters must be initialized and must be present in json, like PointColorMapping, TooltipMappingName and ChartDataLabel.Name . So I tried this:

<SfStockChart Title="Test">
<SfDataManager Url="https://localhost:7253/Ohlc" CrossDomain="true" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager>
<StockChartSeriesCollection>
<StockChartSeries Type="ChartSeriesType.Candle" XName="Date" YName="Close" High="High" Low="Low" Open="Open" Close="Close" Volume="Volume" PointColorMapping="Date" TooltipMappingName="Date" Name="Test">
<ChartMarker>
<ChartDataLabel Visible="false" Name="Date"></ChartDataLabel>
</ChartMarker>
</StockChartSeries>
</StockChartSeriesCollection>
</SfStockChart>

But finally that crash a little further.

Can you make the fields optional and check if candle charts work with odata?

Regards,

Yann



DG Durga Gopalakrishnan Syncfusion Team October 27, 2022 03:06 PM UTC

Hi Yann,


We have considered your reported scenario as bug and logged a defect report for this issue. This fix will be available in our weekly patch release which is scheduled to be rolled out on 15th November 2022. We appreciate your patience until then. You can keep track of the bug from the below feedback link.


Feedback Link :  https://www.syncfusion.com/feedback/38682/candle-stockchart-throws-exception-with-odataadaptor


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.


Regards,

Durga Gopalakrishnan.



PH Phil Holmes October 27, 2022 10:20 PM UTC

Thanks Durga,

When you put the feedback link in these things, could you please also grant permission? Just getting access denied when I try to view.


Regards,

Phil



DG Durga Gopalakrishnan Syncfusion Team October 28, 2022 03:24 PM UTC

Hi Phil,


We regret for inconvenience caused. We have validated the provided feedback link. Please login and check with the feedback link now.


Feedback Link :  https://www.syncfusion.com/feedback/38682/candle-stockchart-throws-exception-with-odataadaptor


Kindly revert us, if you have any concerns.


Regards,

Durga Gopalakrishnan.



PH Phil Holmes October 29, 2022 11:15 PM UTC

Nope, still no access.

Regards,
Phil



SB Swetha Babu Syncfusion Team October 31, 2022 11:44 AM UTC

Hi Phil,


We have modified the feedback link and this can now be accessed.


Regards,

Swetha



DG Durga Gopalakrishnan Syncfusion Team November 15, 2022 03:15 PM UTC

Hi Phil,


We are glad to announce that our v20.3.0.57 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor.Charts NuGet package.


NuGet Package : https://www.nuget.org/packages/Syncfusion.Blazor.Charts/


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon