I need to convince my management that we can do very nice plots using infragistics, up to know this is what I have:
In order have that here is my code : //Set the chart titles ChartPureAlpha.Text = TickerName; //Set Chart legend this.ChartPureAlpha.Legend.Visible = true; this.ChartPureAlpha.Legend.Location = LegendLocation.Right; this.ChartPureAlpha.Legend.Margins.Left = 5; this.ChartPureAlpha.Legend.Margins.Right = 10; this.ChartPureAlpha.Legend.Margins.Top = 15; this.ChartPureAlpha.Legend.Margins.Bottom = 90; this.ChartPureAlpha.Legend.SpanPercentage = 15; this.ChartPureAlpha.LineChart.TreatDateTimeAsString = false; this.ChartPureAlpha.ChartType = ChartType.ScatterChart; this.ChartPureAlpha.ScatterChart.ConnectWithLines = true; //ChartPureAlpha.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; this.ChartPureAlpha.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:dd-MM-yyyy>"; this.ChartPureAlpha.Axis.X.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 25); this.ChartPureAlpha.Axis.X.Labels.SeriesLabels.Visible = true; this.ChartPureAlpha.Axis.X.Labels.SeriesLabels.OrientationAngle = 315; //ChartPureAlpha.Axis.X.TickmarkInterval = 1; //ChartPureAlpha.Axis.X.TickmarkIntervalType = AxisIntervalType.Days; //ChartPureAlpha.Axis.X.TickmarkStyle = AxisTickStyle.DataInterval; // axis label //ChartPureAlpha.TitleBottom.Text = "Date"; //ChartPureAlpha.TitleBottom.HorizontalAlign = StringAlignment.Center; //ChartPureAlpha.TitleLeft.Text = "Raw Alpha)"; //ChartPureAlpha.TitleLeft.HorizontalAlign = StringAlignment.Center; // Create and add series ChartPureAlpha.Series.Add(dowjones);I want to know how to :- reduce marker size- have the whole date (not truncated)- change the label font Thanks for your help
eltorfuerte said:reduce marker size
Maybe one possible approach to achieve this behavior could be:
LineAppearance la = new LineAppearance(ultraChart1); la.IconAppearance.Icon = SymbolIcon.Circle; la.IconAppearance.IconSize = SymbolIconSize.Large; la.LineStyle.EndStyle = LineCapStyle.DiamondAnchor; LineChartAppearance dd = new LineChartAppearance(); dd.LineAppearances.Add(la); myColumnLayer.ChartTypeAppearance = dd;
LineAppearance la = new LineAppearance(ultraChart1);
la.IconAppearance.Icon = SymbolIcon.Circle;
la.IconAppearance.IconSize = SymbolIconSize.Large;
la.LineStyle.EndStyle = LineCapStyle.DiamondAnchor;
LineChartAppearance dd = new LineChartAppearance();
dd.LineAppearances.Add(la);
myColumnLayer.ChartTypeAppearance = dd;
eltorfuerte said:have the whole date (not truncated)
Maybe you could use the property Extend of your Axis. Please take a look at the attached sample for more details.
eltorfuerte said:change the label font
You could try to change it using the code
myColumnLayer.AxisY.Labels.Font = new System.Drawing.Font("Ariel", 10); myColumnLayer.AxisY.Labels.FontColor = Color.Red;
myColumnLayer.AxisY.Labels.Font = new System.Drawing.Font("Ariel", 10);
myColumnLayer.AxisY.Labels.FontColor = Color.Red;
Regards
Thanks a lot for your reply ,
I still have 2 issues :
-I have a message written in red when the ultrachart is empty saying : "To create a composite chart: add a ChartArea ........ from the chartlayer" how i can remove that ?
- Now my plot look like this :
It is not as nice as I would like :
-I need to reduce the legend size
-the X axis looks strange and I cannot label Y axis
I would be more then happy if you have ideas.
Thanks
eltorfuerte said:I have a message written in red when the ultrachart is empty saying : "To create a composite chart: add a ChartArea ........ from the chartlayer" how i can remove that ?
I suppose that you are talking about the message before press the button "Load" from the sample. Maybe the easiest way to remove the message is to supply the UltraChart with appropriate DataSet
eltorfuerte said:-I need to reduce the legend size
CompositeLegend myLegend = new CompositeLegend(); myLegend.PE.Fill = Color.Red; myLegend.ChartLayers.Add(myColumnLayer); myLegend.Bounds = new Rectangle(0, 85, 15, 15); myLegend.BoundsMeasureType = MeasureType.Percentage; myLegend.PE.ElementType = PaintElementType.Gradient; myLegend.PE.FillGradientStyle = GradientStyle.ForwardDiagonal; myLegend.PE.Fill = Color.CornflowerBlue; myLegend.PE.FillStopColor = Color.Transparent; myLegend.Border.CornerRadius = 10; myLegend.Border.Thickness = 1; this.ultraChart1.CompositeChart.Legends.Add(myLegend);
CompositeLegend myLegend = new CompositeLegend();
myLegend.PE.Fill = Color.Red;
myLegend.ChartLayers.Add(myColumnLayer);
myLegend.Bounds = new Rectangle(0, 85, 15, 15);
myLegend.BoundsMeasureType = MeasureType.Percentage;
myLegend.PE.ElementType = PaintElementType.Gradient;
myLegend.PE.FillGradientStyle = GradientStyle.ForwardDiagonal;
myLegend.PE.Fill = Color.CornflowerBlue;
myLegend.PE.FillStopColor = Color.Transparent;
myLegend.Border.CornerRadius = 10;
myLegend.Border.Thickness = 1;
this.ultraChart1.CompositeChart.Legends.Add(myLegend);
eltorfuerte said:the X axis looks strange
I suupose that there are not enough space for the labels. Maybe one possible solution could be if you rotate the labels using the properties:
axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing; axisX.Labels.VerticalAlign = StringAlignment.Far;
axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing;
axisX.Labels.VerticalAlign = StringAlignment.Far;
eltorfuerte said: I cannot label Y axis