MSChart: Remove gaps between series - c#

I am using MSchart Control to represent data graphically. Could you please assist me with the following problem: I put two series to the chart area but there is an evident gap between them. How can I remove it? Consider an example below. There are two series (orange and purple). I would be glad to remove everything between them so they are placed in a continuous manner. If it does matter, X-axis is actually time. Thanks in advance.
!

Series class has an IsXValueIndexed property. When you set it to true, the series data points will be plotted according to their order in the series rather than plotting them according to their time values. Be sure to sort the Series so that all data points are in proper order.

Related

How to set the same number of data points in a Line Chart?

I have multiple series which share the same x-axis but some values are repeated as they have different number of data points. Since this is the case I want to set the same number of data points for all my series.
Is setting empty data points a solution to make all series have the same number of data points or are there any other solutions? If setting empty data points is a solution, how do I use it? My series aren't fixed and vary according to user selection.
They follow:
Chart1.Series[i].XValueMember = "Receipt date";
Chart1.Series[i].YValueMembers = "AvgAgingDays";
Is setting empty data points a solution?
Well, it certainly will achieve the counts to be the same. But how it looks is a different matter.
One question here is where do you inset them (X-Value), probably where they are missing, right?
The other question is what ChartType do your series have? Here are a few typical types:
Point, Bars, Columns: That is fine, just make the Color of the 'empty' Points Transparent!
Line, Area: That is more tricky. You don't want gaps in the lines so you need to keep them visible. And you want the lines to go straight so you need to calculate the Y-Values from the neighbours. Simple for one missing Point, a little bit more work for larger gaps. Not possible for points missing at the start or end. Those should be invisible again..
Spline: Next to impossible to get really right. Either put in some more work or live with some inaccuracies!
If you have a Line chart, to fully document the situation, you may consider adding a Point Series on top with the same data, but with the missing Points invisible.
Btw: If you have correctly set the XValueType as DateTime, all this ought to be unnecessary, as then the missing dates won't matter and the DataPoints all sit at their respective dates. They only shift if you don't have a valid X-Value and/or fitting XValueType.
This is a rather comon mistake because at first it all looks fine but without setting the type it will be string and then you run into trouble when you want to act on the values or rely on their positions or even just format them..
Btw: While it is possible to AddXY the missing points afterwards, it makes things a lot easier if you can detect and add them while adding the real points..

superposing two or more series into one chart in asp.net

I am trying to fetch data from an oracle database and then plot the data accordingly to a chart. It should be relatively easy but the problem is I have to plot more than one field and superimpose them into the same chart. For example there would be four lines in single chart to specify four different fields. So far I can put two/multiple series into one chart with the following code
and the chart looks like this
But I want them to be superimposed on top of each other. I am not really familiar with asp charts so it would be great to have some valuable input on this.
Thanks. The end result should be something like this -
EDIT::: I see what went wrong with the output! So, what I really wanted to know is that those two value in two series will have the same axis or not! I wanted to plot two values with such difference that they couldnt overlap and thought they were using separate axis. So what I am looking for is already here , it was just wrong data values that gave me hard time. The actual figure now looks like -

Teechart Linear Gauge Duplication of axis title for multiple gauges on single chart

I am evaluating Teechart.Net (v4.13.12.13) for Xamarin Android (v4.12) to determine suitability for a project that requires the use of gauges to present data and I've come across a few issues that I haven't been able to figure out:
I would like to add a number of linear gauges to a chart, each with a unique title, but it seems the axis title assigned to the last gauge that was added to the chart is applied to all gauges in the chart. Am I setting the wrong property (LinearGauge.Axis.Title.Text) or is there some other way to assign unique titles to the linear gauges. The other apparent option would be to add a separate chart for each gauge, but that doesn't seem right. In the image below, I need to show two distinct temperatures but both are labelled the same.
I created a circular gauge and enabled the embedded numeric gauge. However, no matter what I try I cannot get any text displayed in the numeric gauge. It is drawn inside the gauge, but no text. I've set CircularGauge.NumericGauge.Chart.AutoRepaint to true, then false and manually repainted, all without success. Is this a bug? I tried the same code with Teechart.Net for Winforms and it works OK so I'm having doubts about the Teechart release for Xamarin.
Any help will be greatly appreciated.
I would like to add a number of linear gauges to a chart, each with a
unique title, but it seems the axis title assigned to the last gauge
that was added to the chart is applied to all gauges in the chart. Am
I setting the wrong property (LinearGauge.Axis.Title.Text) or is there
some other way to assign unique titles to the linear gauges. The other
apparent option would be to add a separate chart for each gauge, but
that doesn't seem right. In the image below, I need to show two
distinct temperatures but both are labelled the same.
This is by design. Gauges use standard chart axes (left and bottom). Each chart has one set of axes and hence the title is being overwritten. Adding separate charts would be the recommendation.
I created a circular gauge and enabled the embedded numeric gauge.
However, no matter what I try I cannot get any text displayed in the
numeric gauge. It is drawn inside the gauge, but no text. I've set
CircularGauge.NumericGauge.Chart.AutoRepaint to true, then false and
manually repainted, all without success. Is this a bug? I tried the
same code with Teechart.Net for Winforms and it works OK so I'm having
doubts about the Teechart release for Xamarin.
Using the code below doesn't plot text in the NumericGauge in WinForms either. Can you please modify it so that we can reproduce the problem here?
CircularGauge circularGauge1 = new CircularGauge(tChart1.Chart);
circularGauge1.NumericGauge.Visible = true;
Thanks in advance.

How to calculate the column/bar segments width in WPF programatically?

I have googled many times with different keywords, but could not find an e-book for drawing different charts.
Ok my problem is I am drawing a column chart, I want the column chart to calculate the segment width based on the number of segments it has. Does anyone know how I could do this?
Thanks and Regards,
Mawy
Try to use the WPF toolkit, reference System.Windows.Controls.DataVisualization.Toolkit.dll . You can find some samples here, it should be pretty simple, create your collection of KeyValuePair containing your data and then bind to the Key and the Value properties. More about the column charts here. If you use this you won't need extra work for the width or height of the columns.

Display unsorted data in SL3 line chart

I'm having trouble with my Silverlight Chart. My model is unsorted, that is, the sorting is done on the server side. It needs to support year transitions, but as you can see from the screenshot the charting control automatically sorts the model and fills in the gaps. The line sort be ever increasing and not taking a dip on new year.
How can I make the chart display the data in the order specified in the grid control to the left?
Btw, using SL3
alt text http://img705.imageshack.us/img705/7602/unsortedsilverlightchar.png
The line chart is not designed to do the task you seem to be asking. After all the purpose of a line chart is to help the user trace a trend or even visually interpolate an interim value. However if the interval between horizontal points is not linear and always traveling in the same direction such lines meaningless.
I would therefore suggest that the Line chart is not appropriate or that you have some other hidden data which should be used for the Y-axis which would make the lines meaningful.
Alternatives might be to use a Scatter graph or a Column series where the y-axis value has been converted to a string and thus cause the series to use a Category based axis instead of range based one.

Categories

Resources