in

Software FX Community

Discuss and find help for all Software FX products.

Clearing the Datasource set to a ChartFx chart control

Last post 06-25-2010 2:03 AM by eromurugan. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-24-2010 1:33 AM

    Clearing the Datasource set to a ChartFx chart control

    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.

    Filed under: ,
  • 05-27-2010 12:43 PM In reply to

    • CarlosAC
    • Top 10 Contributor
    • Joined on 02-04-2009
    • Costa Rica

    Re: Clearing the Datasource set to a ChartFx chart control

    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
  • 05-27-2010 11:01 PM In reply to

    Re: Clearing the Datasource set to a ChartFx chart control

    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.
  • 05-28-2010 10:46 AM In reply to

    • CarlosAC
    • Top 10 Contributor
    • Joined on 02-04-2009
    • Costa Rica

    Re: Clearing the Datasource set to a ChartFx chart control

    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
  • 06-04-2010 10:47 AM In reply to

    Re: Clearing the Datasource set to a ChartFx chart control

    Thanks, Carlos I will mail the picture to the support and get their help too in finding a solution to this issue.

     

  • 06-25-2010 2:03 AM In reply to

    Re: Clearing the Datasource set to a ChartFx chart control

    Answer

    Hi,

    I got a solution and fixed the issue. I included the following statements to clear the datasource for the chart before assigning new chart datasource.

    ChartFx1.Data.Clear();
    ChartFx1.DataSourceSettings.Fields.Clear();

    Thanks a lot all suggestion.

Page 1 of 1 (6 items)
Copyright 2008 Software FX, Inc.