Пример #1
0
        public void ShowInChart(TChart tchart, TChartHorizLine destLine, Map destMap, Map collapseMap)
        {
            if (line != null && destLine != null)
            {
                foreach (LineDots lineDots in line)
                {
                    destLine.Add(lineDots.Value, lineDots.Pos);
                }
            }

            if (map != null && destMap != null)
            {
                foreach (MapDots mapDots in map)
                {
                    int i;
                    using (Polygon polygonToAdd = new Polygon(destMap.Shapes, tchart.Chart))
                    {
                        polygonToAdd.Add(mapDots.ValueStart, mapDots.PosStart);
                        polygonToAdd.Add(mapDots.ValueEnd, mapDots.PosStart);
                        polygonToAdd.Add(mapDots.ValueEnd, mapDots.PosEnd);
                        polygonToAdd.Add(mapDots.ValueStart, mapDots.PosEnd);
                        i = destMap.Shapes.Add(polygonToAdd);
                    }
                    destMap.Repaint();

                    destMap.Shapes[i].ParentBrush = false;
                    destMap.Shapes[i].Color       = mapDots.MapColor;
                    //tgtMap.Shapes[i].Text = info;

                    destMap.Shapes[i].ParentPen   = false;
                    destMap.Shapes[i].Pen.Visible = false;

                    if (collapseMap != null)
                    {
                        using (Polygon polygonToAdd = new Polygon(collapseMap.Shapes, tchart.Chart))
                        {
                            polygonToAdd.Add(0, mapDots.PosStart);
                            polygonToAdd.Add(100, mapDots.PosStart);
                            polygonToAdd.Add(100, mapDots.PosEnd);
                            polygonToAdd.Add(0, mapDots.PosEnd);
                            i = collapseMap.Shapes.Add(polygonToAdd);
                        }
                        collapseMap.Repaint();

                        collapseMap.Shapes[i].ParentBrush = false;
                        collapseMap.Shapes[i].Color       = mapDots.MapColor;

                        collapseMap.Shapes[i].ParentPen   = false;
                        collapseMap.Shapes[i].Pen.Visible = false;
                    }
                }
            }
        }
Пример #2
0
        public void SetChartLineThreshold(float threshold, int num)
        {
            HorizLine line = new Steema.TeeChart.Styles.HorizLine();

            line.LinePen.Style = System.Drawing.Drawing2D.DashStyle.Dash;
            line.Color         = LINE_THRESHOLD_COLORS[num];
            line.LinePen.Width = 2;
            line.Add(MainForm.dateTimeRangeMeasure.start, threshold);
            line.Add(MainForm.dateTimeRangeMeasure.end, threshold);

            tChart.Series.Add(line);
            tChart.Series[tChart.Series.Count - 1].ShowInLegend = false;
        }