User (Legacy) Posted February 11, 2007 Report Share Posted February 11, 2007 Hi, I am currently evaluating charting components for our C# project and was wondering if this is possible or easy to do in ChartFX. I have an application that executes a stored procedure that takes criteria based on user input. The result set (get loaded in a datatable) currently is bounded to a regular DataGridView. Now I have a need to chart the data, aside from being displayed on the DataGridView. Here is the Result Set layout. ID Timestamp D1 D1Q D5 D5Q D8 D8Q .... 1 1/1/07 00:05 35 blue 24.5 red 24 blue 2 1/1/07 00:10 38 blue 36.3 green 28 red 3 1/1/07 00:15 32 green 32.9 green 26 blue 4 1/1/07 00:20 36 blue 28.8 red 28 blue Again, the number of columns returned by the stored procedure depends the user selected items. So, items could be 1 or 30 or 100. And the number of rows returned depends on the time range selected. Dx are the values that will how on the chart. The DxQ columns, will be used in the chart also but will not show. It will dictate what colour the a particular point (symbol) should show. For example, for the D1 column, 35 should show as blue, 38, green, 32 blue and 36 blue. For D5 column, 24.5 should show as red, 36.3 green, 32.9 green, 28.8 red. All the columns will follow this pattern. So on the chart what I want to show is: The Timestamp on X-Axis and D1, D5, D8, etc in the Y-Axis. The ID and DxQ will not show. Currently there is another component that I tried and it was able to do the above requirements but would like to try other products like ChartFX. Any idea? Please let me know. Thank you. Rick.. Basically, data will be coming from a stored proc call. The number of columns of the result set depends on the user's selected items. So each item selected show as 1 column in the result set. In addition to each column, there is an addition column for each user selected item (column) that will dictate how the color will show for that particular point of the item. That is, for every individual item there is a corresponding piece of info that holds the colour of the point. Only the item point will show on the chart with the dictated color, There is a Timestamp in the result set (1st column) and we want this to be our X-Axis of the line chart. The rest of the columns in the result set will be the data in the Y-Axis. Here is an simple example of the result set: The DnQ, number values represent color. Timestamp D1 D1Q D2 D2Q D5 D5Q .... 1/1/07 00:05 35 blue 24.5 red 24 blue 1/1/07 00:10 38 blue 36.3 green 28 red 1/1/07 00:15 32 green 32.9 green 26 blue 1/1/07 00:20 36 blue 28.8 red 28 blue . . . Is this something that is easy to do using .netCharting? Link to comment Share on other sites More sharing options...
Software FX Posted February 11, 2007 Report Share Posted February 11, 2007 You can definitely achieve this with Chart FX. You will supply only the columns Dx and TimeStamp, you can do this by adding the TimeStamp and Dx columns to the Fields collection in the DataSourceSettings property. You will need to go to your schema before the chart´s databinding is performed in order to know which columns you want to display and appropriately add them to the Fields collection. For the DxQ columns there is no direct functionality in Chart FX that will determine the color of a point based on another field not being displayed, however there is what we call "Conditional Attributes" that can be used for this purpose: Normally conditional attributes acc upon the same value being displayed (Dx in this case), however, you can override this behavior by capturing the ConditionalAttributesCallback event, this event is invoked for each point in the chart and you will be able to decide which attribute in the Conditional Attributes collection you want to use for that particular point. In your case, you will initially fill the ConditionalAttributes collection with all the possible colors points could take and then in the event, using the additional DxQ information (that you will get from some data structure in your program) return the appropriate index. If you are not storing the DxQ values anywhere in your program, you may want to add them to the chart as series anyways, hide those series and then use these values in the ConditionalAttributesCallback event handler. -- Francisco Padron www.chartfx.com "Rick Shaw" <rickshaw888*NOSPAM*@hotmail.com> wrote in message news:v5K9Y7aTHHA.620@webserver3.softwarefx.com... > Hi, I am currently evaluating charting components for our C# project and > was wondering if this is possible or easy to do in ChartFX. > I have an application that executes a stored procedure that takes criteria > based on user input. The result set (get loaded in a datatable) currently > is bounded to a regular DataGridView. Now I have a need to chart the > data, aside from being displayed on the DataGridView. Here is the Result > Set layout. > > ID Timestamp D1 D1Q D5 D5Q D8 D8Q .... > 1 1/1/07 00:05 35 blue 24.5 red 24 blue > 2 1/1/07 00:10 38 blue 36.3 green 28 red > 3 1/1/07 00:15 32 green 32.9 green 26 blue > 4 1/1/07 00:20 36 blue 28.8 red 28 blue > > Again, the number of columns returned by the stored procedure depends the > user selected items. So, items could be 1 or 30 or 100. > And the number of rows returned depends on the time range selected. > > Dx are the values that will how on the chart. The DxQ columns, will be > used in the chart also but will not show. It will dictate what colour the > a particular point (symbol) should show. For example, for the D1 column, > 35 should show as blue, 38, green, 32 blue and 36 blue. For D5 column, > 24.5 should show as red, 36.3 green, 32.9 green, 28.8 red. All the > columns will follow this pattern. So on the chart what I want to show is: > > The Timestamp on X-Axis and D1, D5, D8, etc in the Y-Axis. The ID and DxQ > will not show. > > Currently there is another component that I tried and it was able to do > the above requirements but would like to try other products like ChartFX. > > Any idea? Please let me know. > > Thank you. > > Rick.. > > > > > > Basically, data will be coming from a stored proc call. The number of > columns of the result set depends on the user´s selected items. > So each item selected show as 1 column in the result set. In addition to > each column, there is an addition column for each user selected item > (column) that will dictate how the color will show for that particular > point of the item. That is, for every individual item there is a > corresponding piece of info that holds the colour of the point. Only the > item point will show on the chart with the dictated color, There is a > Timestamp in the > result set (1st column) and we want this to be our X-Axis of the line > chart. The rest of the columns in the result set will be the data in the > Y-Axis. > > Here is an simple example of the result set: > The DnQ, number values represent color. > > Timestamp D1 D1Q D2 D2Q D5 D5Q .... > 1/1/07 00:05 35 blue 24.5 red 24 blue > 1/1/07 00:10 38 blue 36.3 green 28 red > 1/1/07 00:15 32 green 32.9 green 26 blue > 1/1/07 00:20 36 blue 28.8 red 28 blue > . > . > . > > Is this something that is easy to do using .netCharting? > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.