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

Displaying XAxis labels in SfCartesianChart without a data source

Hello,

 I am looking to fetch data for the chart separately and display the chart component (e.g., “SfCartesianChart”) before the data fetch is complete. This is to improve the user experience during the waiting time for data fetching. However, it seems that, for example, in the case of SfCartesianChart, the XAxis labels cannot be displayed without a data source, perhaps because they are matched to the data source’s index. How can I display the XAxis labels before the data source is available?

Thank you in advance for your assistance.


3 Replies 1 reply marked as answer

YG Yuvaraj Gajaraj Syncfusion Team April 4, 2023 10:31 AM UTC

Hi Takuya,


In CategoryAxis the axis labels are rendered based on the data source only and it is the default behavior of the CategoryAxis in a chart and having the default range when the empty data source is not possible. So, if the fetched data point x value is numeric or date-time then use the NumericAxis or DateTimeAxis respectively instead of CategoryAxis.


Regards,

Yuvaraj.


Marked as answer

TH Takuya Hara April 6, 2023 02:17 AM UTC

Thank you. The problem is solved, thank you for your help.



YG Yuvaraj Gajaraj Syncfusion Team April 6, 2023 06:52 AM UTC

Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.


Loader.
Up arrow icon