Jump to content
Software FX Community

Clearing the Datasource set to a ChartFx chart control


eromurugan

Recommended Posts

Hi,

I need to display the chart on click of a button in a web page. 

On click of a button, I hit the DB to get data and bind them to the chart controls in the web page.

On second click of the button, the data is bound to the chart control for second time. this makes bar chart with two colors for each of the data bound to it.

I need to clear the datasource set to chart and reassign new datasource. How can this me achieved? Help me with some suggestions.

Link to comment
Share on other sites

Hi eromurugan

If you want to clear the datasource, you can use the following code:

Chart1.Data.Clear();

Also, if you previously add some FieldMaps, you should clear that Collection too and, if you want, add some new FieldMaps. In order to clear the FieldMaps Collection, please use the following code:

chart1.DataSourceSettings.Fields.Clear();

Carlos Chaves

Link to comment
Share on other sites

Hi CarlosAC,

Thanks for the reply.

I tried to clear the datasource using Chart1.Data.Clear() method and them bind the new data but still during the second bind, it assume both the datasource set and display the comparison like chart with bars for two datasource.

Thanks in advance.

Link to comment
Share on other sites

Hi eromurugan

In order to help you I need to see exactly what is the behavior with the first binding, and then compare it with the second binding. Please contact Software FX Support at support[at]softwarefx[dot]com with a small repro case of this issue. Also, attach a couple of images describing the facts you are seeing.

Please remember to include the serial number of your product as well.

Carlos Chaves

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...