2

I have created a chart in ExtJS4 using Ext.create('Ext.chart.Chart'), I wnat to show an empty text msg e.g "No data" to chart if the store is empty.Could you please help me?

user1032018
  • 21
  • 1
  • 3

1 Answers1

1

You can use a technique similar to the one discussed in this answer. Charts have an items property that can be used to add text sprites to the chart.

Set up an event handler on the store to watch for changes to the number of records. If the store is empty (count === 0) then add some preconfigured "No Data" text sprite to chart.items.

Community
  • 1
  • 1
Eric
  • 6,965
  • 26
  • 32