Example #1
0
 internal void MergeOptions(SLStockChartOptions sco)
 {
     this.HasDropLines    = sco.HasDropLines;
     this.DropLines       = sco.DropLines.Clone();
     this.HasHighLowLines = sco.HasHighLowLines;
     this.HighLowLines    = sco.HighLowLines.Clone();
     this.HasUpDownBars   = sco.HasUpDownBars;
     this.UpDownBars      = sco.UpDownBars.Clone();
 }
Example #2
0
        internal SLStockChartOptions Clone()
        {
            SLStockChartOptions sco = new SLStockChartOptions();

            sco.iGapWidth       = this.iGapWidth;
            sco.byOverlap       = this.byOverlap;
            sco.ShapeProperties = this.ShapeProperties.Clone();
            sco.HasDropLines    = this.HasDropLines;
            sco.DropLines       = this.DropLines.Clone();
            sco.HasHighLowLines = this.HasHighLowLines;
            sco.HighLowLines    = this.HighLowLines.Clone();
            sco.HasUpDownBars   = this.HasUpDownBars;
            sco.UpDownBars      = this.UpDownBars.Clone();

            return(sco);
        }
 internal void MergeOptions(SLStockChartOptions sco)
 {
     this.HasDropLines = sco.HasDropLines;
     this.DropLines = sco.DropLines.Clone();
     this.HasHighLowLines = sco.HasHighLowLines;
     this.HighLowLines = sco.HighLowLines.Clone();
     this.HasUpDownBars = sco.HasUpDownBars;
     this.UpDownBars = sco.UpDownBars.Clone();
 }
Example #4
0
        /// <summary>
        /// Set a stock chart using one of the built-in stock chart types.
        /// </summary>
        /// <param name="ChartType">A built-in stock chart type.</param>
        /// <param name="Options">Chart customization options.</param>
        public void SetChartType(SLStockChartType ChartType, SLStockChartOptions Options)
        {
            this.Is3D = SLChartTool.Is3DChart(ChartType);

            int i;
            int iBarChartType;

            SLDataSeriesChartType vType;
            int iChartType;
            switch (ChartType)
            {
                case SLStockChartType.HighLowClose:
                    vType = SLDataSeriesChartType.StockChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);

                    for (i = 0; i < this.PlotArea.DataSeries.Count; ++i)
                    {
                        this.PlotArea.DataSeries[i].ChartType = vType;
                        if (this.IsStylish)
                        {
                            this.PlotArea.DataSeries[i].Options.Line.Width = 2.25m;
                            this.PlotArea.DataSeries[i].Options.Line.CapType = DocumentFormat.OpenXml.Drawing.LineCapValues.Round;
                            this.PlotArea.DataSeries[i].Options.Line.SetNoLine();
                            this.PlotArea.DataSeries[i].Options.Line.JoinType = SLA.SLLineJoinValues.Round;
                            this.PlotArea.DataSeries[i].Options.Marker.Symbol = C.MarkerStyleValues.None;
                        }
                    }

                    // this is for Close
                    if (this.PlotArea.DataSeries.Count > 2)
                    {
                        this.PlotArea.DataSeries[2].Options.Marker.Symbol = C.MarkerStyleValues.Dot;
                        this.PlotArea.DataSeries[2].Options.Marker.Size = 3;
                        if (IsStylish)
                        {
                            this.PlotArea.DataSeries[2].Options.Marker.Fill.SetSolidFill(A.SchemeColorValues.Accent3, 0, 0);
                            this.PlotArea.DataSeries[2].Options.Marker.Line.Width = 0.75m;
                            this.PlotArea.DataSeries[2].Options.Marker.Line.SetSolidLine(A.SchemeColorValues.Accent3, 0, 0);
                        }
                    }

                    this.PlotArea.UsedChartOptions[iChartType].HasHighLowLines = true;
                    if (this.IsStylish)
                    {
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.25m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.JoinType = SLA.SLLineJoinValues.Round;
                    }

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                    this.PlotArea.PrimaryValueAxis.AxisPosition = C.AxisPositionValues.Left;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;

                    if (this.IsStylish)
                    {
                        this.PlotArea.PrimaryTextAxis.ShowMajorGridlines = false;
                        this.PlotArea.PrimaryTextAxis.Fill.SetNoFill();
                        // 2.25 pt width
                        this.PlotArea.PrimaryTextAxis.Line.Width = 0.75m;
                        this.PlotArea.PrimaryTextAxis.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.PrimaryTextAxis.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.PrimaryTextAxis.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.PrimaryTextAxis.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.85m, 0);
                        this.PlotArea.PrimaryTextAxis.Line.JoinType = SLA.SLLineJoinValues.Round;
                        SLRstType rst = new SLRstType();
                        rst.AppendText(" ", new SLFont()
                        {
                            FontScheme = DocumentFormat.OpenXml.Spreadsheet.FontSchemeValues.Minor,
                            FontSize = 9,
                            Bold = false,
                            Italic = false,
                            Underline = DocumentFormat.OpenXml.Spreadsheet.UnderlineValues.None,
                            Strike = false
                        });
                        this.PlotArea.PrimaryTextAxis.Title.SetTitle(rst);
                        this.PlotArea.PrimaryTextAxis.Title.Fill.SetSolidFill(A.SchemeColorValues.Text1, 0.35m, 0);

                        this.PlotArea.PrimaryValueAxis.MinorTickMark = C.TickMarkValues.None;
                    }

                    if (this.IsStylish) this.Legend.LegendPosition = C.LegendPositionValues.Bottom;
                    this.PlotArea.SetDataSeriesAutoAxisType();
                    this.ShowEmptyCellsAs = C.DisplayBlanksAsValues.Gap;
                    break;
                case SLStockChartType.OpenHighLowClose:
                    vType = SLDataSeriesChartType.StockChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);

                    for (i = 0; i < this.PlotArea.DataSeries.Count; ++i)
                    {
                        this.PlotArea.DataSeries[i].ChartType = vType;
                        if (this.IsStylish)
                        {
                            // 2.25 pt width
                            this.PlotArea.DataSeries[i].Options.Line.Width = 2.25m;
                            this.PlotArea.DataSeries[i].Options.Line.CapType = DocumentFormat.OpenXml.Drawing.LineCapValues.Round;
                            this.PlotArea.DataSeries[i].Options.Line.SetNoLine();
                            this.PlotArea.DataSeries[i].Options.Line.JoinType = SLA.SLLineJoinValues.Round;
                            this.PlotArea.DataSeries[i].Options.Marker.Symbol = C.MarkerStyleValues.None;
                        }
                    }

                    this.PlotArea.UsedChartOptions[iChartType].HasHighLowLines = true;
                    this.PlotArea.UsedChartOptions[iChartType].HasUpDownBars = true;
                    if (this.IsStylish)
                    {
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.25m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.JoinType = SLA.SLLineJoinValues.Round;

                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.GapWidth = 150;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Fill.SetSolidFill(A.SchemeColorValues.Light1, 0, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.SetSolidLine(A.SchemeColorValues.Text1, 0.35m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.JoinType = SLA.SLLineJoinValues.Round;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Fill.SetSolidFill(A.SchemeColorValues.Dark1, 0.25m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.SetSolidLine(A.SchemeColorValues.Text1, 0.35m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.JoinType = SLA.SLLineJoinValues.Round;
                    }

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                    this.PlotArea.PrimaryValueAxis.AxisPosition = C.AxisPositionValues.Left;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;

                    if (this.IsStylish) this.Legend.LegendPosition = C.LegendPositionValues.Bottom;
                    this.PlotArea.SetDataSeriesAutoAxisType();
                    this.ShowEmptyCellsAs = C.DisplayBlanksAsValues.Gap;
                    break;
                case SLStockChartType.VolumeHighLowClose:
                    vType = SLDataSeriesChartType.StockChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);

                    iBarChartType = (int)SLDataSeriesChartType.BarChartColumnPrimary;
                    for (i = 0; i < this.PlotArea.DataSeries.Count; ++i)
                    {
                        if (i == 0)
                        {
                            this.PlotArea.DataSeries[i].ChartType = SLDataSeriesChartType.BarChartColumnPrimary;
                            if (this.IsStylish)
                            {
                                this.PlotArea.DataSeries[i].Options.Fill.SetSolidFill(A.SchemeColorValues.Accent1, 0, 0);
                                // 2.25 pt width
                                this.PlotArea.DataSeries[i].Options.Line.Width = 2.25m;
                                this.PlotArea.DataSeries[i].Options.Line.SetNoLine();
                            }

                            this.PlotArea.UsedChartTypes[iBarChartType] = true;
                            this.PlotArea.UsedChartOptions[iBarChartType].BarDirection = C.BarDirectionValues.Column;
                            this.PlotArea.UsedChartOptions[iBarChartType].BarGrouping = C.BarGroupingValues.Clustered;
                            if (Options != null)
                            {
                                this.PlotArea.UsedChartOptions[iBarChartType].GapWidth = Options.GapWidth;
                                this.PlotArea.UsedChartOptions[iBarChartType].Overlap = Options.Overlap;
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.Fill = Options.Fill.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.Outline = Options.Border.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.EffectList.Shadow = Options.Shadow.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.EffectList.Glow = Options.Glow.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.EffectList.SoftEdge = Options.SoftEdge.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.Format3D = Options.Format3D.Clone();
                            }
                        }
                        else
                        {
                            this.PlotArea.DataSeries[i].ChartType = vType;
                            if (this.IsStylish)
                            {
                                // 2.25 pt width
                                this.PlotArea.DataSeries[i].Options.Line.Width = 2.25m;
                                this.PlotArea.DataSeries[i].Options.Line.CapType = DocumentFormat.OpenXml.Drawing.LineCapValues.Round;
                                this.PlotArea.DataSeries[i].Options.Line.SetNoLine();
                                this.PlotArea.DataSeries[i].Options.Line.JoinType = SLA.SLLineJoinValues.Round;
                                this.PlotArea.DataSeries[i].Options.Marker.Symbol = C.MarkerStyleValues.None;
                            }
                        }
                    }

                    // this is for Close
                    if (this.PlotArea.DataSeries.Count > 3)
                    {
                        this.PlotArea.DataSeries[3].Options.Marker.Symbol = C.MarkerStyleValues.Dot;
                        this.PlotArea.DataSeries[3].Options.Marker.Size = 5;
                        if (IsStylish)
                        {
                            this.PlotArea.DataSeries[3].Options.Marker.Fill.SetSolidFill(A.SchemeColorValues.Accent4, 0, 0);
                            this.PlotArea.DataSeries[3].Options.Marker.Line.Width = 0.75m;
                            this.PlotArea.DataSeries[3].Options.Marker.Line.SetSolidLine(A.SchemeColorValues.Accent4, 0, 0);
                        }
                    }

                    this.PlotArea.UsedChartOptions[iChartType].HasHighLowLines = true;
                    if (this.IsStylish)
                    {
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.25m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.JoinType = SLA.SLLineJoinValues.Round;
                    }

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                    this.PlotArea.PrimaryValueAxis.AxisPosition = C.AxisPositionValues.Left;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;
                    this.PlotArea.HasSecondaryAxes = true;
                    this.PlotArea.SecondaryValueAxis.AxisPosition = C.AxisPositionValues.Right;
                    this.PlotArea.SecondaryValueAxis.ForceAxisPosition = true;
                    this.PlotArea.SecondaryValueAxis.IsCrosses = true;
                    this.PlotArea.SecondaryValueAxis.Crosses = C.CrossesValues.Maximum;
                    this.PlotArea.SecondaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;
                    //this.PlotArea.SecondaryValueAxis.OtherAxisIsCrosses = true;
                    //this.PlotArea.SecondaryValueAxis.OtherAxisCrosses = C.CrossesValues.AutoZero;
                    this.PlotArea.SecondaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                    this.PlotArea.SecondaryTextAxis.TickLabelPosition = C.TickLabelPositionValues.NextTo;
                    //this.PlotArea.SecondaryTextAxis.IsCrosses = true;
                    //this.PlotArea.SecondaryTextAxis.Crosses = C.CrossesValues.AutoZero;
                    this.PlotArea.SecondaryTextAxis.OtherAxisIsCrosses = true;
                    this.PlotArea.SecondaryTextAxis.OtherAxisCrosses = C.CrossesValues.Maximum;

                    if (this.IsStylish)
                    {
                        this.PlotArea.SecondaryValueAxis.ShowMajorGridlines = true;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.Width = 0.75m;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.85m, 0);
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.JoinType = SLA.SLLineJoinValues.Round;

                        this.PlotArea.SecondaryTextAxis.ClearShapeProperties();
                    }

                    if (this.IsStylish) this.Legend.LegendPosition = C.LegendPositionValues.Bottom;
                    this.PlotArea.SetDataSeriesAutoAxisType();
                    this.ShowEmptyCellsAs = C.DisplayBlanksAsValues.Gap;
                    break;
                case SLStockChartType.VolumeOpenHighLowClose:
                    vType = SLDataSeriesChartType.StockChart;
                    this.IsCombinable = SLChartTool.IsCombinationChartFriendly(vType);
                    iChartType = (int)vType;
                    this.PlotArea.UsedChartTypes[iChartType] = true;
                    if (Options != null) this.PlotArea.UsedChartOptions[iChartType].MergeOptions(Options);

                    iBarChartType = (int)SLDataSeriesChartType.BarChartColumnPrimary;
                    for (i = 0; i < this.PlotArea.DataSeries.Count; ++i)
                    {
                        if (i == 0)
                        {
                            this.PlotArea.DataSeries[i].ChartType = SLDataSeriesChartType.BarChartColumnPrimary;
                            if (this.IsStylish)
                            {
                                this.PlotArea.DataSeries[i].Options.Fill.SetSolidFill(A.SchemeColorValues.Accent1, 0, 0);
                                // 2.25 pt width
                                this.PlotArea.DataSeries[i].Options.Line.Width = 2.25m;
                                this.PlotArea.DataSeries[i].Options.Line.SetNoLine();
                            }

                            iBarChartType = (int)SLDataSeriesChartType.BarChartColumnPrimary;
                            this.PlotArea.UsedChartTypes[iBarChartType] = true;
                            this.PlotArea.UsedChartOptions[iBarChartType].BarDirection = C.BarDirectionValues.Column;
                            this.PlotArea.UsedChartOptions[iBarChartType].BarGrouping = C.BarGroupingValues.Clustered;
                            if (Options != null)
                            {
                                this.PlotArea.UsedChartOptions[iBarChartType].GapWidth = Options.GapWidth;
                                this.PlotArea.UsedChartOptions[iBarChartType].Overlap = Options.Overlap;
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.Fill = Options.Fill.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.Outline = Options.Border.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.EffectList.Shadow = Options.Shadow.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.EffectList.Glow = Options.Glow.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.EffectList.SoftEdge = Options.SoftEdge.Clone();
                                this.PlotArea.DataSeries[i].Options.ShapeProperties.Format3D = Options.Format3D.Clone();
                            }
                        }
                        else
                        {
                            this.PlotArea.DataSeries[i].ChartType = vType;
                            if (this.IsStylish)
                            {
                                // 2.25 pt width
                                this.PlotArea.DataSeries[i].Options.Line.Width = 2.25m;
                                this.PlotArea.DataSeries[i].Options.Line.CapType = DocumentFormat.OpenXml.Drawing.LineCapValues.Round;
                                this.PlotArea.DataSeries[i].Options.Line.SetNoLine();
                                this.PlotArea.DataSeries[i].Options.Line.JoinType = SLA.SLLineJoinValues.Round;
                                this.PlotArea.DataSeries[i].Options.Marker.Symbol = C.MarkerStyleValues.None;
                            }
                        }
                    }

                    this.PlotArea.UsedChartOptions[iChartType].HasHighLowLines = true;
                    this.PlotArea.UsedChartOptions[iChartType].HasUpDownBars = true;
                    if (this.IsStylish)
                    {
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.25m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].HighLowLines.Line.JoinType = SLA.SLLineJoinValues.Round;

                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.GapWidth = 150;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Fill.SetSolidFill(A.SchemeColorValues.Light1, 0, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.SetSolidLine(A.SchemeColorValues.Text1, 0.35m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.UpBars.Border.JoinType = SLA.SLLineJoinValues.Round;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Fill.SetSolidFill(A.SchemeColorValues.Dark1, 0.25m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.Width = 0.75m;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.CapType = A.LineCapValues.Flat;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.SetSolidLine(A.SchemeColorValues.Text1, 0.35m, 0);
                        this.PlotArea.UsedChartOptions[iChartType].UpDownBars.DownBars.Border.JoinType = SLA.SLLineJoinValues.Round;
                    }

                    this.PlotArea.HasPrimaryAxes = true;
                    this.PlotArea.PrimaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                    this.PlotArea.PrimaryValueAxis.AxisPosition = C.AxisPositionValues.Left;
                    this.PlotArea.PrimaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;
                    this.PlotArea.HasSecondaryAxes = true;
                    this.PlotArea.SecondaryValueAxis.AxisPosition = C.AxisPositionValues.Right;
                    this.PlotArea.SecondaryValueAxis.ForceAxisPosition = true;
                    this.PlotArea.SecondaryValueAxis.IsCrosses = true;
                    this.PlotArea.SecondaryValueAxis.Crosses = C.CrossesValues.Maximum;
                    this.PlotArea.SecondaryValueAxis.CrossBetween = C.CrossBetweenValues.Between;
                    //this.PlotArea.SecondaryValueAxis.OtherAxisIsCrosses = true;
                    //this.PlotArea.SecondaryValueAxis.OtherAxisCrosses = C.CrossesValues.AutoZero;
                    this.PlotArea.SecondaryTextAxis.AxisPosition = C.AxisPositionValues.Bottom;
                    this.PlotArea.SecondaryTextAxis.TickLabelPosition = C.TickLabelPositionValues.NextTo;
                    //this.PlotArea.SecondaryTextAxis.IsCrosses = true;
                    //this.PlotArea.SecondaryTextAxis.Crosses = C.CrossesValues.AutoZero;
                    this.PlotArea.SecondaryTextAxis.OtherAxisIsCrosses = true;
                    this.PlotArea.SecondaryTextAxis.OtherAxisCrosses = C.CrossesValues.Maximum;

                    if (this.IsStylish)
                    {
                        this.PlotArea.SecondaryValueAxis.ShowMajorGridlines = true;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.Width = 0.75m;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.CapType = A.LineCapValues.Flat;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.CompoundLineType = A.CompoundLineValues.Single;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.Alignment = A.PenAlignmentValues.Center;
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.SetSolidLine(A.SchemeColorValues.Text1, 0.85m, 0);
                        this.PlotArea.SecondaryValueAxis.MajorGridlines.Line.JoinType = SLA.SLLineJoinValues.Round;

                        this.PlotArea.SecondaryTextAxis.ClearShapeProperties();
                    }

                    if (this.IsStylish) this.Legend.LegendPosition = C.LegendPositionValues.Bottom;
                    this.PlotArea.SetDataSeriesAutoAxisType();
                    this.ShowEmptyCellsAs = C.DisplayBlanksAsValues.Gap;
                    break;
            }
        }
Example #5
0
 /// <summary>
 /// Creates an instance of SLStockChartOptions with theme information.
 /// </summary>
 /// <returns>An SLStockChartOptions object with theme information.</returns>
 public SLStockChartOptions CreateStockChartOptions()
 {
     SLStockChartOptions sco = new SLStockChartOptions(this.listThemeColors, this.IsStylish);
     return sco;
 }
        internal SLStockChartOptions Clone()
        {
            SLStockChartOptions sco = new SLStockChartOptions();
            sco.iGapWidth = this.iGapWidth;
            sco.byOverlap = this.byOverlap;
            sco.ShapeProperties = this.ShapeProperties.Clone();
            sco.HasDropLines = this.HasDropLines;
            sco.DropLines = this.DropLines.Clone();
            sco.HasHighLowLines = this.HasHighLowLines;
            sco.HighLowLines = this.HighLowLines.Clone();
            sco.HasUpDownBars = this.HasUpDownBars;
            sco.UpDownBars = this.UpDownBars.Clone();

            return sco;
        }