/// <summary> /// Constructor supporting XYGraph with plugged in components /// </summary> public Chart4Plots1X4YLegends( PlotArea newPlotArea0, PlotArea newPlotArea1, PlotArea newPlotArea2, PlotArea newPlotArea3, LegendScrollerX newLegendScrollerX, LegendScrollerY newLegendScrollerY0, LegendScrollerY newLegendScrollerY1, LegendScrollerY newLegendScrollerY2, LegendScrollerY newLegendScrollerY3, int newHeightRatio0 = 1, int newHeightRatio1 = 1, int newHeightRatio2 = 1, int newHeightRatio3 = 1) { PlotArea0 = plotArea0 = Add(newPlotArea0); PlotArea1 = plotArea1 = Add(newPlotArea1); PlotArea2 = plotArea2 = Add(newPlotArea2); PlotArea3 = plotArea3 = Add(newPlotArea3); LegendScrollerY0 = legendScrollerY0 = Add(newLegendScrollerY0); legendScrollerY0.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY0.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerY0.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY0.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerY1 = legendScrollerY1 = Add(newLegendScrollerY1); legendScrollerY1.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY1.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerY1.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY1.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerY2 = legendScrollerY2 = Add(newLegendScrollerY2); legendScrollerY2.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY2.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerY2.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY2.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerY3 = legendScrollerY3 = Add(newLegendScrollerY3); legendScrollerY3.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY3.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerY3.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY3.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerX = legendScrollerX = Add(newLegendScrollerX); if (newHeightRatio0 <= 0 || newHeightRatio1 <= 0 || newHeightRatio2 <= 0 || newHeightRatio3 <= 0) { throw new ArgumentException("HeightRatio cannot be 0 or negative."); } double totalHight = newHeightRatio0 + newHeightRatio1 + newHeightRatio2 + newHeightRatio3; heightRatio0 = newHeightRatio0 / totalHight; heightRatio1 = newHeightRatio1 / totalHight; heightRatio2 = newHeightRatio2 / totalHight; heightRatio3 = newHeightRatio3 / totalHight; AddZoomButtons(); }
/// <summary> /// Add LegendScrollerX to control /// </summary> protected LegendScrollerX Add(LegendScrollerX newLegendScrollerX) { LegendScrollerXs.Add(newLegendScrollerX); Zoomers.Add(newLegendScrollerX); newLegendScrollerX.VerticalAlignment = System.Windows.VerticalAlignment.Top; newLegendScrollerX.ZoomStateChanged += legendScroller_ZoomStateChanged; AddChild(newLegendScrollerX); return(newLegendScrollerX); }
/// <summary> /// Constructor supporting Chart1Plot1X1YLegend with plugged in components /// </summary> public Chart1Plot1X1YLegend(PlotArea newPlotArea, LegendScrollerX newLegendScrollerX, LegendScrollerY newLegendScrollerY) { PlotArea = plotArea = Add(newPlotArea); LegendScrollerY = legendScrollerY = Add(newLegendScrollerY); legendScrollerY.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerY.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerY.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerX = legendScrollerX = Add(newLegendScrollerX); AddZoomButtons(); }
/// <summary> /// Constructor supporting XYGraph with plugged in components /// </summary> public Chart2Plots1X2YLegends(PlotArea newPlotAreaUpper, PlotArea newPlotAreaLower, LegendScrollerX newLegendScrollerX, LegendScrollerY newLegendScrollerYUpper, LegendScrollerY newLegendScrollerYLower) { PlotAreaUpper = plotAreaUpper = Add(newPlotAreaUpper); PlotAreaLower = plotAreaLower = Add(newPlotAreaLower); LegendScrollerYUpper = legendScrollerYUpper = Add(newLegendScrollerYUpper); legendScrollerYUpper.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerYUpper.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerYUpper.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerYUpper.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerYLower = legendScrollerYLower = Add(newLegendScrollerYLower); legendScrollerYLower.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerYLower.HorizontalContentAlignment = HorizontalAlignment.Stretch; legendScrollerYLower.Legend.HorizontalAlignment = HorizontalAlignment.Stretch; legendScrollerYLower.Legend.HorizontalContentAlignment = HorizontalAlignment.Left; LegendScrollerX = legendScrollerX = Add(newLegendScrollerX); AddZoomButtons(); }
// ----------- public RendererGridLineY(LegendScrollerX legendScrollerx, Brush strokeBrush, double strokeThickness) : //gridlineY are parallel to vertical y-line, but the distance between them is controlled by LegendX, therefore dimension X base(strokeBrush, strokeThickness, DimensionMapX) { LegendScrollerX = legendScrollerx; }