Hi ,
I filling an ultrachart with a numerictimeseries. I want to know if it is possible to remove week end, on the time line ?
Thanks
Hello Eltorfuerte,
I`m not famlar with your scenario, but maybe you could used FillSceneGraph() method and remove weekend from the chart. I made small sample for you with such kind scenario. Please take a look at the attached sample. Also you could take a look at another forum thread where I discuss something similar: http://community.infragistics.com/forums/t/63830.aspx
Also you could take a look in our online documentation. Topic "Customize the display of Null Values": http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.2/CLR2.0/html/Chart_Customize_the_Display_of_Null_Values.html
Also, maybe you could try other possible approach - to exclude from your DataSet all values with weekends and then to apply your filtered DataSet to your UltraChart.
Please let me know if you have any questions
Hi Thanks a lot for your answer, however it is not exactly what I want . I would like to have every point linked. Which mean that for the example you gave one should not see gap between 09/03/2012 and 12/03/2012 and between 16/03/2012 and 19/03/2012.
Do you know how one can do that ?
Hi,
I just tried it bu it does not work because the null is replaced by a 0 , whcih is invisible to .NullHandling .
So, in such kind scenario ( where we are not able to set Null values ), my suggestion is to set 0 (zero) instead of Null. Also we will used option 2 with small modification to achieve desired behavior . Please take a look below at the new version of Option 2
ultraChart1.ChartType = ChartType.LineChart; ultraChart1.Data.SwapRowsAndColumns = true; ultraChart1.Axis.X.Extent = 120; var a = from q in dt.AsEnumerable() where (double)q.ItemArray.GetValue(1) != 0 select q; ultraChart1.DataSource = a.AsDataView();
ultraChart1.ChartType = ChartType.LineChart;
ultraChart1.Data.SwapRowsAndColumns = true;
ultraChart1.Axis.X.Extent = 120;
var a = from q in dt.AsEnumerable()
where (double)q.ItemArray.GetValue(1) != 0
select q;
ultraChart1.DataSource = a.AsDataView();
Let me know if you have any questions.
Regards
The problem is that I am not filling my ultragrid with a datatable but with a NumericTimeDataPoint. Moreover, it is not an ultrachart but a scatterchart.
Is option 2 is adaptable to this scenario ?
Sorry, but I`m confused from your response.
eltorfuerte said:The problem is that I am not filling my ultragrid with a datatable
In my scenario I`m using DataTable as a datasource to our UltraChart. I`m not using UltraGrid.
eltorfuerte said:Moreover, it is not an ultrachart but a scatterchart.
Now, about the main task with the Points. I`m confuse why we should add a points (Saturday and Sunday ) to our Points collection. Just add one IF condition and exclude it (do not added this points to Points collection).
Please let me know if you think that I misunderstood your scenario and questions.
Sorry for the misunderstanding , I meant that you are using Datatable to fill the ultragrid and I am using NumericTimeSeries.
Here is my graph :
As you can see, week ends are visible even if they are not in the numerictimeseries. What I want to do is just to remove the spaces corresponding to it.
Thanks for your help and patience
Thanks, however, I have already removed Saturday and Friday that is the reason why you have spaces every 5 points on the graph I sent.
Thanks for provided code. My suggestion is to add IF condition and exclude the points for Saturday and Sunday. For example:
for (int i = 0; i < test.Rows.Count; i++) { try { if (Convert.ToDateTime(test.Rows[i][0]).DayOfWeek != DayOfWeek.Saturday && Convert.ToDateTime(test.Rows[i][0]).DayOfWeek != DayOfWeek.Sunday) { InitNumeric.Points.Add(new NumericTimeDataPoint((DateTime)test.Rows[i][0], (double)test.Rows[i][9] * 100, "A", false)); } } catch (InvalidCastException) { InitNumeric.Points.Add(new NumericTimeDataPoint((DateTime)test.Rows[i][0], Convert.ToDouble(null), "A", false)); } }
for (int i = 0; i < test.Rows.Count; i++)
{
try
if (Convert.ToDateTime(test.Rows[i][0]).DayOfWeek != DayOfWeek.Saturday && Convert.ToDateTime(test.Rows[i][0]).DayOfWeek != DayOfWeek.Sunday)
InitNumeric.Points.Add(new NumericTimeDataPoint((DateTime)test.Rows[i][0], (double)test.Rows[i][9] * 100, "A", false));
}
catch (InvalidCastException)
InitNumeric.Points.Add(new NumericTimeDataPoint((DateTime)test.Rows[i][0], Convert.ToDouble(null), "A", false));
this is my scenario :
for (int i = 0; i < test.Rows.Count; i++) { try { InitNumeric.Points.Add(new NumericTimeDataPoint((DateTime)test.Rows[i][0], (double)test.Rows[i][9] * 100, "A", false)); } catch (InvalidCastException) { InitNumeric.Points.Add(new NumericTimeDataPoint((DateTime)test.Rows[i][0],Convert.ToDouble(null), "A", false)); } }
NewStyle.ApplyGraphic(ChartAlphaRealized, Tick.Name, "Days");
ChartAlphaRealized.CompositeChart.Series.Clear(); ChartAlphaRealized.CompositeChart.Series.Add(InitNumeric);
public void ApplyGraphic(Infragistics.Win.UltraWinChart.UltraChart ChartToStyle, String PlotNAme, String IntervalleDays) { //Set the chart titles ChartToStyle.TitleTop.Text = PlotNAme; ChartToStyle.TitleTop.Font = new Font("Arial", 19, FontStyle.Bold | FontStyle.Regular, GraphicsUnit.Point); //Set Chart legend ChartToStyle.Legend.Visible = true; ChartToStyle.Legend.Location = LegendLocation.Right; ChartToStyle.Legend.Margins.Left = 5; ChartToStyle.Legend.Margins.Right = 10; ChartToStyle.Legend.Margins.Top = 7; ChartToStyle.Legend.Margins.Bottom = 45; ChartToStyle.Legend.SpanPercentage = 15; ChartToStyle.LineChart.TreatDateTimeAsString = false; ChartToStyle.ChartType = ChartType.ScatterChart; ChartToStyle.ScatterChart.ConnectWithLines = true; //axis X ChartToStyle.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:dd-MM>"; ChartToStyle.Axis.X.Extent = 15; ChartToStyle.Axis.X.Labels.Orientation = TextOrientation.Horizontal; ChartToStyle.Axis.X.Labels.VerticalAlign = StringAlignment.Far; ChartToStyle.Axis.X.TickmarkInterval = 1; if (IntervalleDays == "Days") { ChartToStyle.Axis.X.TickmarkIntervalType = AxisIntervalType.Days; } else { ChartToStyle.Axis.X.TickmarkIntervalType = AxisIntervalType.Weeks; } ChartToStyle.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval; //ChartToStyle.Axis.X.Labels.FontColor = Color.Red; // axis Y ChartToStyle.Axis.Y.TickmarkInterval = 1; // icon size ChartToStyle.ScatterChart.IconSize = SymbolIconSize.Small; // sets the thickness of the line ChartToStyle.ScatterChart.LineAppearance.Thickness = 50; ChartToStyle.LineChart.Thickness = 50; LineAppearance la = new LineAppearance(ChartToStyle); la.IconAppearance.Icon = SymbolIcon.Circle; la.IconAppearance.IconSize = SymbolIconSize.Large; la.LineStyle.EndStyle = LineCapStyle.DiamondAnchor; la.Thickness = 50; // axis font ChartToStyle.Axis.Y.Labels.Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Regular, GraphicsUnit.Point); ChartToStyle.Axis.X.Labels.Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Regular, GraphicsUnit.Point); // axis label ChartToStyle.TitleBottom.Text = "Date"; ChartToStyle.TitleBottom.Font = new Font("Arial", 15, FontStyle.Bold | FontStyle.Regular, GraphicsUnit.Point); ChartToStyle.TitleBottom.Margins.Bottom = -1; ChartToStyle.TitleBottom.HorizontalAlign = StringAlignment.Center; //ChartToStyle.TitleLeft.Text = "Alpha cumulated"; ChartToStyle.TitleLeft.Font = new Font("Arial", 15, FontStyle.Bold | FontStyle.Regular, GraphicsUnit.Point); ChartToStyle.TitleLeft.Margins.Bottom = -1; ChartToStyle.TitleLeft.HorizontalAlign = StringAlignment.Center; }
Maybe you should set this property: ultraChart1.Axis.X.TimeAxisStyle.TimeAxisStyle = RulerGenre.Discrete;
Also, could you please upload your sample in this forum thread. I`ll be glad to research your scenario and I`ll try to find solution.Regards