Jump to content
Software FX Community

Please let me know if this is possible with Chart FX


Mohamed
 Share

Recommended Posts

 Please let me know is this possible with Chart FX, if possible please help me out on this

4  |

3 |

2 |   Please assume There are three series Red, Blue and Green

1 |   are ploted against the corresponding Xaxis Red, Blue, Green values

|_________________________________________________________________________

| |  |   |  | |   | |   |

  Red1   Blue1 Green1 Red2  Blue2  Green2  Red3 Blue3   Green3

 

 

Series 1 -  (Red) have two arrays for the red series that is

Red_values - {1,5,7}

Red_Xvalues - {Red1,Red2,Red3}

All the data in the Red_value arrays should only be ploted against the Red_xvalues(xaxis value)  

 

series 2 - ( Blue) have two arrays for the Blue series that is

Blue_values - {2, 4 , 6}

Blue_Xvalues - {Blue1,Blue2,Blue3}

All the data in the Blue_value arrays should only be ploted against the Blue_xvalues(xaxis value)

 

series 3 -  (Green) have two arrays for the Green series that is

Green_values - {3, 5 , 8}

Green_Xvalues - {Green1,Green2,Green3}

All the data in the Green_value arrays should only be ploted against the Green_xvalues(xaxis value)

 

So totally I have six Arrays that is 3 value arrays that is for plotting the series against the corresponding 3 Xvalue  (xaxis).

I mean Red_values against Red_xvalues, Blue_values against blue_xvalues, green_values against green_xvalues.

This has to be done on one chart because to see the difference in trend between the 3 series.

Thanks

Link to comment
Share on other sites

You can create this chart in ChartFX by using an XY chart (Scatter, Line, etc.) but note that ChartFX expects 1 datasource so you need 1 "master" source for all your data. You can use the ChartFX.WinForms.DataProvider.ListProvider class for this purpose, e.g.

double[] redValues = new double[] { 10, 12, 8 };double[] redXValues = new double[] { 1, 2, 4 };double[] blueValues = new double[] { 6, 14, 9 };double[] blueXValues = new double[] { 1, 3, 5 };

ArrayList listOfArrays = new ArrayList();listOfArrays.Add(redValues);listOfArrays.Add(redXValues);listOfArrays.Add(blueValues);listOfArrays.Add(blueXValues);ChartFX.WinForms.DataProviders.ListProvider listProvider = new ListProvider(listOfArrays);FieldMapCollection fields = chart1.DataSourceSettings.Fields;fields.Clear();fields.Add(new FieldMap("Field1", FieldUsage.Value));fields.Add(new FieldMap("Field2", FieldUsage.XValue));fields.Add(new FieldMap("Field3", FieldUsage.Value));fields.Add(new FieldMap("Field4", FieldUsage.XValue));

chart1.Gallery = Gallery.Lines;chart1.DataSource = listProvider;

Please note that in the FieldMap we have to use FieldXX where XX is 1-based so that the list provider knows which of the arrays we are referring to.

Hope this helps

JuanC

Link to comment
Share on other sites

Thanks for your timely help.

 I am using Chart FX 6.0 version with Asp.net 2.0(webforms) on visual studio 2005. The feild map collection is a .Net 1.1 object. I could not find the feildmapcollection in .net 2.0. Is there any alternate for that in .Net 2.0.

I would really appreciate your help on this.

Thank you very much.

 

Link to comment
Share on other sites

I am sorry, I posted code using the "ChartFX for Visual Studio 2005" API.

This would be the code for ChartFX 6.X (I tested this under 6.2, if it does not work in 6.0 there is a free upgrade path to 6.2)

double[] redValues = new double[] { 10, 12, 8 };double[] redXValues = new double[] { 1, 2, 4 };double[] blueValues = new double[] { 6, 14, 9 };double[] blueXValues = new double[] { 1, 3, 5 };

ArrayList listOfArrays = new ArrayList();listOfArrays.Add(redValues);listOfArrays.Add(redXValues);listOfArrays.Add(blueValues);listOfArrays.Add(blueXValues);SoftwareFX.ChartFX.Data.ListProvider listProvider = new SoftwareFX.ChartFX.Data.ListProvider(listOfArrays);chart1.DataSourceSettings.DataType[0] = DataType.Value;chart1.DataSourceSettings.DataType[1] = DataType.XValue;chart1.DataSourceSettings.DataType[2] = DataType.Value;chart1.DataSourceSettings.DataType[3] = DataType.XValue;

chart1.Gallery =

Gallery.Lines;chart1.DataSource = listProvider;

Regards,

JuanC

Link to comment
Share on other sites

Hi JuanC,

 

Thank you very much for your kind help, I was able to do that and got some more customization in the same chart.

As you can clearly see in the below chart that there are 3 different groups of labels in X axis .

Question1: How to have3 different color labels for the 3 different groups in the Xaxis.

 

 4  |

3 |

2 |   Please assume There are three series Red, Blue and Green

1 |   are ploted against the corresponding Xaxis Red, Blue, Green values

|_________________________________________________________________________

| |  |   |  | |   | |   |

  Red1   Blue1 Green1 Red2  Blue2  Green2  Red3 Blue3   Green3

 

FYI: 

I have sent you the clear chart image and code I used to support@softwarefx.com.(yesterday)

 

Question 2:

I am using the below code for drilldown chart(intractive points links to other pages with parameter)

Chart1.Point(0, u).Link.Url =

"http://localhost/CostAnalysis/Ce_SumTrendList.aspx?pt=" & encrypted & ""

when I use this code and click on any part of page status bar in my aspx page shows "error on page"  (on the click of both inside the chart area and also in all part of the aspx page) .

Please let me know should I change the settings in chart property.

 

 

 

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...