How to Bind data from Web api in Stock chart.

Hello,

I am using Stock chart control in MVC project. I have Web api  and API giving me data. I want to bind Api data in Stock chart control and display Stock chart according api data. 

Please provide me solution that how i bind API data in stock chart in MVC project.


3 Replies

NP Nishanthi Panner Selvam Syncfusion Team September 25, 2023 08:05 AM UTC

Cyrille,


Greetings from Syncfusion.


We can bind the api data in stockchart using dataManager. The DataManager requires minimal information like webservice URL, adaptor and crossDomain to interact with service endpoint properly. Assign the instance of DataManager to the DataSource property in series and map the fields of data to XName and YName properties.


We have attached the Sample Browser and documentation for your reference.


Sample Browser: https://ej2.syncfusion.com/aspnetmvc/Chart/RemoteData#/material3

Documentation: https://ej2.syncfusion.com/aspnetmvc/documentation/chart/working-with-data#remote-data


Kindly revert us if you have any concerns.


Regards,

Nishanthi




CY Cyrille September 28, 2023 06:15 PM UTC

Thanks for response. I have one more question here, How to download Stock chart data in Excel file?



NP Nishanthi Panner Selvam Syncfusion Team September 29, 2023 11:15 AM UTC

Cyrille,


We can download stock chart data through the 'Export' function, which allows you to export the data in both XLSX (Excel) and CSV formats.


We have attached a sample browser demo for your reference.


Sample Browser: https://ej2.syncfusion.com/aspnetmvc/StockChart/Default#/material3


Click the Export button to access the export options for XLSX and CSV formats, which will allow you to export the stock chart data in Excel.


Kindly revert us if you have any concerns.


Regards,

Nishanthi


Loader.
Up arrow icon