Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1300
align column chart and spline chart
posted

Hi,

 

I have a composite chart (column chart + splinechart) , both series have the same number of point with the same dates, however, the column chart is not aligned with the date of the splince chart.

Do you have any explanation ?

 

Thanks

Parents
  • 71886
    Offline posted

    Hello,

    Could you please try the following code:

    ultraChart1.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval;

    Please feel free to let me know if I misunderstood you or if you have any other questions.

  • 1300
    posted in reply to [Infragistics] Boris Toromanov

    Hi Boris ,

     

    No it does not fix the problem, this is  what I have know :In addition I want to see the first points and the last points of the curve and and have both bars closer (2 by 2) here is my scenario :

                //column layers use a string, GroupBySeries x axis
                AxisItem columnXAxis = new AxisItem(ChartAlphaRealized, AxisNumber.X_Axis);
                columnXAxis.DataType = AxisDataType.String;
                columnXAxis.SetLabelAxisType = Infragistics.UltraChart.Core.Layers.SetLabelAxisType.GroupBySeries;
                columnXAxis.Labels.ItemFormat = AxisItemLabelFormat.ItemLabel;
                columnXAxis.Labels.SeriesLabels.Format = AxisSeriesLabelFormat.SeriesLabel;
                columnXAxis.MajorGridLines.Visible = false;
                columnXAxis.LineDrawStyle = LineDrawStyle.Solid;
                ChartAlphaRealized.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval;
                columnXAxis.Visible = false;
                area.Axes.Add(columnXAxis);

                //line layers use a string, ContinuousData x axis
                AxisItem lineXAxis = new AxisItem(ChartAlphaRealized, AxisNumber.X_Axis);
                lineXAxis.DataType = AxisDataType.String;
                lineXAxis.SetLabelAxisType = Infragistics.UltraChart.Core.Layers.SetLabelAxisType.ContinuousData;
                lineXAxis.MajorGridLines.Visible = false;
                lineXAxis.Labels.ItemFormat = AxisItemLabelFormat.Custom;
                lineXAxis.Labels.ItemFormatString = "<ITEM_LABEL>";
                lineXAxis.LineDrawStyle = LineDrawStyle.Solid;
                lineXAxis.Visible = true;
                lineXAxis.LineColor = Color.Black;
                lineXAxis.Labels.SeriesLabels.Format = AxisSeriesLabelFormat.SeriesLabel;
                ChartAlphaRealized.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval;
                area.Axes.Add(lineXAxis);

                //the layers can share the numeric y axis.
                AxisItem YAxis = new AxisItem(ChartAlphaRealized, AxisNumber.Y_Axis);
                //area.Axes.Clear();
                YAxis.DataType = AxisDataType.Numeric;
                YAxis.OrientationType = AxisNumber.Y_Axis;
                YAxis.MajorGridLines.Visible = false;
                YAxis.RangeType = AxisRangeType.Custom;
                if ( MAxAlphaCumulValue <= 1) MAxAlphaCumulValue = 1;
                YAxis.RangeMax = Math.Round(MAxAlphaCumulValue);
                YAxis.RangeMin = Math.Round(MinAlphaCumulValue);
                YAxis.TickmarkInterval = GlobalClass.StepCalc(MinAlphaCumulValue, MAxAlphaCumulValue);
                YAxis.TickmarkStyle = AxisTickStyle.DataInterval;
                YAxis.Labels.ItemFormatString = "<DATA_VALUE:##.##>";
                area.Axes.Add(YAxis);

                //the layers can share the numeric y axis.
                AxisItem YAxis2 = new AxisItem(ChartAlphaRealized, AxisNumber.Y2_Axis);
                //area.Axes.Clear();
                YAxis2.DataType = AxisDataType.Numeric;
                YAxis2.Labels.ItemFormat = AxisItemLabelFormat.DataValue;
                YAxis2.MajorGridLines.Visible = false;
                YAxis2.RangeType = AxisRangeType.Custom;
                YAxis2.RangeMax = MAxVolumeCumulValue;
                YAxis2.RangeMin = 0;
                YAxis2.LineColor = Color.LightGreen;
                YAxis2.Labels.ItemFormatString = "<DATA_VALUE:##.##>";
                YAxis2.TickmarkInterval = 5;
                YAxis2.TickmarkStyle = AxisTickStyle.DataInterval;
                area.Axes.Add(YAxis2);

                ChartLayerAppearance columnLayer = new ChartLayerAppearance();
                columnLayer.AxisX = columnXAxis;
                columnLayer.AxisY = YAxis2;
                columnLayer.ChartArea = area;
                columnLayer.ChartType = ChartType.ColumnChart;
                columnLayer.Series.Add(VolumeNum);
                columnLayer.Series.Add(VolumeNumDV);
                columnLayer.SwapRowsAndColumns = true;
                ChartAlphaRealized.CompositeChart.ChartLayers.Add(columnLayer);

                ChartLayerAppearance lineLayer = new ChartLayerAppearance();
                lineLayer.AxisX = lineXAxis;
                lineLayer.AxisY = YAxis;
                lineLayer.ChartArea = area;
                lineLayer.ChartType = ChartType.SplineChart;
                lineLayer.Series.Add(AlphaReal_st);
                lineLayer.Series.Add(seriesInit);
                lineLayer.Series.Add(VWAP_St);
                lineLayer.Series.Add(ClosedPrice_St);
                lineLayer.Series.Add(VWAP_Sector);
                lineLayer.Series.Add(ClosedPrice_Sector);
                lineLayer.Series.Add(TradedPrice_Sector);
                lineLayer.Series.Add(seriesInit_Sector);
                ChartAlphaRealized.CompositeChart.ChartLayers.Add(lineLayer);

                //create LineAppearance for 1st NumericTimeSeries      
                ChartLayerAppearance lineLayer_line = new ChartLayerAppearance();
                lineLayer_line.AxisX = lineXAxis;
                lineLayer_line.AxisY = YAxis;
                lineLayer_line.ChartArea = area;
                lineLayer_line.ChartType = ChartType.LineChart;
                LineAppearance la = new LineAppearance(ChartAlphaRealized);
                la.IconAppearance.Icon = SymbolIcon.None;
                la.Thickness = 2;
                LineChartAppearance lca = new LineChartAppearance();
                lca.LineAppearances.Add(la);
                lineLayer_line.ChartTypeAppearance = lca;
                lineLayer_line.Series.Add(SerieLineZeros);


                ChartAlphaRealized.CompositeChart.ChartLayers.Add(lineLayer_line);

                TradedPrice_Sector.Visible = false;

                NewAlphaChart = ChartAlphaRealized;
                tab_AlphaRealized.Controls.Add(NewAlphaChart);

                ChartPureAlpha.Data.DataBind();
                ChartAlphaRealized.Data.DataBind();

    thanks

Reply Children