Jump to content
Software FX Community

Multiseries editable chart from a single DataSource - how?

User (Legacy)

Recommended Posts

Platform: VB.NET Winforms app.

Keeping this brief, this app I'm working on has a table that is umpteen rows

of 80 columns of data. We have a grid on a screen which has its DataSource

set to this table. We would like the user to be able to highlight one or

more columns in that grid, and have those values get charted in a ChartFX

control. For example, let's say the user highlights 3 columns - then it

would graph 3 series in the Chart, one for each column.

The data in the grid is editable - if the user changes a value in the grid,

we want it to reflect in the chart. Likewise, if the user grabs a point on

the chart (AllowDrag is true) and moves it up and down, we want the values

in the grid to reflect the changed value. Since we need to keep all of this

in sync, we'd like to be able to use the same DataSource for both the Grid

and the ChartFX control.

Is this possible? When I set the chart's DataSource property to the grid's

DataSource, it tries to graph all the columns (or something - it's really

wonky looking). My gut feeling is that this isn't possible - that I'll have

to manually create a collection for each column's data that has been

selected and add it to a ListProvider, and set the Chart's DataSource equal

to THAT, which would be bad from a synchronization standpoint when our users

start editing data. Please tell me I'm wrong and there's an easy way to do

this ;)


Link to comment
Share on other sites

That depends on the grid.

If the grid can provide you with a DataSet that includes only the selected

items, then yes, you can pass this DataSet to Chart FX and Chart FX will

read it. However, if the DataGrid gives you the whole DataSet and has

properties that tell you what range was selected, you will need to do this

on your own either by creating a DataSet that contains the data you are

interested in plotting or by simple passing this data directly to the chart,

point by point, using the Chart FX API (OpenData - CloseData approach).

You will have to respond to DataChange events in the DataGrid to update the

data in the chart.



Software FX, Inc.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...