Jump to content
Software FX Community

How to bind two tables to one chart alternatively


Guest Tingjun Fan

Recommended Posts

Guest Tingjun Fan

I have two datatables, say tb1 and tb2. tb1 contains four columns: month, expense, revenue, net. tb2 contains two columns: month, wine sales.

 

I need to display the chart for tb1 and tb2 alternatively.

 

I use the following statement to bind the data to the chart tFXChart:

 

tFXChart.DataSourceSettings.FillFromSchema();

tFXChart.DataSource = tb1;

 

No problem there.

 

But later on when I tried to do the same thing by replacing tb1 with tb2, the chart shows errors.

 

If I tried to add code like the following before the lines, I got different types of errors or tb2 just fails to show (saying no data).

 

tFXChart.Series.Clear();

tFXChart.DataSourceSettings.DataFields.Clear();

 

Can someone tell me what I'm missing? Thanks in advance for your help.

Link to comment
Share on other sites

  • 7 years 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...