Jump to content
Software FX Community

Series data not showing as seperate series


munfried

Recommended Posts

I have a DataTable that I'm building in the code-behind file of my page.  I have the data and chartfx setup to display multiple data series in the chart, but when the chart is created, I see all the data (charted correctly) but displayed as a single series in all the same color with connecting lines from where one series hits the right side of the chart and the next series begins again on the left.  The series' are constructed sequentially, so the "SeriesID" values are always kept "together".  Details are below.

 The data is in the following format:

SeriesID XPlot Value
0 1.678 37.8
0 1.792 35.2
0 1.94 34.1
1 1.678 52.7
1 1.792 48.3
1 1.94 42.159

I have the chart setup in the ASPX with the following code:


ContextMenus="false" ToolBar-Visible="false" LegendBox-Visible="true" LegendBox-Dock="top">

<AxisY Title-Text="Value" LabelAngle="90" />

<AxisX Title-Text="XPlot" />

<SpecialObjects>

<chartfxadornments:SimpleBorder AssemblyName="ChartFX.WebForms.Adornments" Color="109, 125, 138">

</chartfxadornments:SimpleBorder>

<chartfx.webforms.dataproviders.crosstabdataprovider assemblyname="ChartFX.WebForms.Data"></chartfx.webforms.dataproviders.crosstabdataprovider>

</SpecialObjects>

<DataSourceSettings>

<Fields>

<chartfx7:FieldMap Name="Value" Usage="Value" />

<chartfx7:FieldMap Name="XPlot" Usage="XValue" />

<chartfx7:FieldMap Name="SeriesID" Usage="ColumnHeading" />

</Fields>

</DataSourceSettings>

<AllSeries MarkerShape="none" Line-Width="2" />

</chartfx7:Chart>

 

The ChartFX control is inside an update panel.  The data is constructed by running a number of user-entered values through a series of calculations and populating the calculated values into a DataTable ("dt") instantiated within the same method.  The actual C# code which is assigning the DataSource and setting the Axis' Min/Max follows:

this.chartfx.DataSource = dt;

this.chartfx.AxisY.Max = (maxPlot > 0) ? maxPlot + (Math.Abs(maxPlot - minPlot) / 5) : 100;this.chartfx.AxisY.Min = minPlot - (Math.Abs(maxPlot - minPlot) / 5);

this.chartfx.AxisX.Min = xMin;this.chartfx.AxisX.Max = (xMax > 0) ? xMax : 7; this.chartfx.DataBind();

this.updatePanelChart.Update();

 

Anybody have any thoughts as to why this is occuring?  I have used almost exactly this same setup before, which the exception of building the data dynamically in the code-behind.  I've already spent hours trying to figure this one out.  It was working at one point, but in trying to make the subsequent series (1+ created dynamically based on the calculations) have no plot markers, I apparently broke the whole thing and now I can't for the life of me figure out what's happened.  Any help would be greatly appreciated.  Thanks.

Link to comment
Share on other sites

What your doing is very similar to what I was doing. Have you ever looked into a CrosstabDataProvider?

If you use that, all you have to worry about is your data, ChartFX will create all the series for you without any extra effort.

Click this link to view more about CrosstabDataProviders:

http://support.softwarefx.com/samples/CfxNET6/Tutorial/Crosstab.htm

Your data is in the same format that's needed for crosstab. I would try this out, it will save you a headache (or five).

Link to comment
Share on other sites

You are so my new favorite person ;)

I have the Chart control setup for CrossTab, but I didn't realize I had to bind the data source this way in the code behind.  I think I'm going to have to construct my data into a columnar format after all, due to the requirement of the "RowHeading" setting.  I would much rather just give my chart a span of "1 to 7" and then give it an x-coordinate for plot, but this information will be "extremely" useful in the future.

 You rock! ;)  Thanks.

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.

×
×
  • Create New...