To reproduce:
- Use HTML- like text formatting in the chart title.
- Export the chart to image.
- The tags are shown in the text.
Workaround:
private void radButton1_Click(object sender, EventArgs e)
{
radChartView1.ShowTitle = false;
TextPrimitiveHtmlImpl impl = new TextPrimitiveHtmlImpl();
TextParams textParams = this.radChartView1.ChartElement.TitleElement.TextParams;
SizeF size = impl.MeasureOverride(new SizeF(500f, 200), textParams);
using (MemoryStream stream = new MemoryStream())
{
radChartView1.ExportToImage(stream, new Size(500, 500 - (int)size.Height));
Bitmap bmp = new Bitmap(500, 500);
using (Graphics g = Graphics.FromImage(bmp))
{
g.Clear(Color.White);
textParams.paintingRectangle = new RectangleF(Point.Empty, size);
impl.PaintPrimitive(new RadGdiGraphics(g), textParams);
g.DrawImage(Image.FromStream(stream), 0, size.Height, 500, 500 - size.Height);
}
bmp.Save(@"D:\xfile.bmp");
}
radChartView1.ShowTitle = true;
}
To reproduce:
BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
barSeries.Name = "Q1";
barSeries.CombineMode = ChartSeriesCombineMode.Stack;
barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley"));
barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White"));
barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith"));
barSeries.DataPoints.Add(new CategoricalDataPoint(111, "Jones"));
barSeries.DataPoints.Add(new CategoricalDataPoint(118, "Marshall"));
this.radChartView1.Series.Add(barSeries);
BarSeries barSeries2 = new BarSeries("Performance", "RepresentativeName");
barSeries2.Name = "Q2";
barSeries2.CombineMode = ChartSeriesCombineMode.Stack;
barSeries2.DataPoints.Add(new CategoricalDataPoint(153, "Harley"));
barSeries2.DataPoints.Add(new CategoricalDataPoint(141, "White"));
barSeries2.DataPoints.Add(new CategoricalDataPoint(130, "Smith"));
barSeries2.DataPoints.Add(new CategoricalDataPoint(88, "Jones"));
barSeries2.DataPoints.Add(new CategoricalDataPoint(109, "Marshall"));
this.radChartView1.Series.Add(barSeries2);
BarSeries barSeries3 = new BarSeries("Performance", "RepresentativeName");
barSeries3.Name = "Q3";
barSeries3.CombineMode = ChartSeriesCombineMode.Stack;
barSeries3.DataPoints.Add(new CategoricalDataPoint(153, "Harley"));
barSeries3.DataPoints.Add(new CategoricalDataPoint(141, "White"));
barSeries3.DataPoints.Add(new CategoricalDataPoint(130, "Smith"));
barSeries3.DataPoints.Add(new CategoricalDataPoint(88, "Jones"));
barSeries3.DataPoints.Add(new CategoricalDataPoint(109, "Marshall"));
this.radChartView1.Series.Add(barSeries3);
this.radChartView1.ShowTrackBall = true;
Note: the trackball labels should be displayed in the order the series are displayed in the chart view.
Workaround:
private void ChartTrackballController_TextNeeded(object sender, TextNeededEventArgs e)
{
string pattern = " \\d+.?\\d* ";
StringBuilder sb = new StringBuilder("<html>");
List<DataPointInfo> points = new List<DataPointInfo>();
foreach (DataPointInfo dp in e.Points)
{
points.Add(dp);
}
points.Reverse();
foreach (DataPointInfo dp in points)
{
Color pointColor = this.GetColorForDataPoint(dp.Series, dp.DataPoint);
string color = string.Format("{0},{1},{2},{3}", pointColor.A, pointColor.R, pointColor.G, pointColor.B);
sb.AppendFormat("<color={0}>{1}", color, string.Format("{0} {1}", dp.Series.Name, ((CategoricalDataPoint)dp.DataPoint).Value));
sb.AppendLine();
}
e.Text = sb.ToString();
}
protected virtual Color GetColorForDataPoint(ChartSeries series, DataPoint point)
{
if (series is IndicatorBase)
{
return series.BorderColor;
}
foreach (UIChartElement element in series.Children)
{
DataPointElement pointElement = element as DataPointElement;
if (pointElement != null)
{
if (pointElement.DataPoint.Equals(point))
{
if (pointElement.BackColor.A > 0)
{
return pointElement.BackColor;
}
else
{
return pointElement.BorderColor;
}
}
}
}
return Color.Black;
}
Workaround: use the ChartTrackerballController.TextNeeded event.
To reproduce: - Use the attached file to reproduce. Workaround: - Reset the chart data source: THIS-OBJECT:radChartView1:DataSource = ?. THIS-OBJECT:radChartView1:DataSource = THIS-OBJECT:bindingSource1.
To reproduce:
- Implement the drill down functionality with a PieSeries.
- Workaround:
class MyPieSeries : PieSeries, ILegendInfoProvider
{
public LegendItemCollection LegendInfos
{
get
{
return new LegendItemCollection();
}
}
}
To reproduce: - Just add StochasticSlowIndicator to a chart.
To reproduce:
public RadForm1()
{
InitializeComponent();
this.radChartView1.AreaType = ChartAreaType.Pie;
PieSeries series = new PieSeries();
series.DataPoints.Add(new PieDataPoint(50, "Germany"));
series.DataPoints.Add(new PieDataPoint(70, "United States"));
series.DataPoints.Add(new PieDataPoint(40, "France"));
series.DataPoints.Add(new PieDataPoint(25, "United Kingdom"));
series.ShowLabels = true;
this.radChartView1.Series.Add(series);
radChartView1.ShowLegend = true;
}
Random rnd = new Random();
private void radButton1_Click(object sender, EventArgs e)
{
this.radChartView1.Series[0].DataPoints.RemoveAt(0);
this.radChartView1.Series[0].DataPoints.Add(new PieDataPoint(rnd.Next(100), rnd.Next(100).ToString()));
}
Workaround:
private void radButton1_Click(object sender, EventArgs e)
{
this.radChartView1.Series[0].DataPoints.RemoveAt(0);
this.radChartView1.Series[0].DataPoints.Add(new PieDataPoint(50, rnd.Next(100).ToString()));
this.radChartView1.ChartElement.LegendElement.Items.Clear();
foreach (PieSeries series in radChartView1.Series)
{
for (int i = 0; i < series.DataPoints.Count; i++)
{
var dataPoint = series.DataPoints[i] as PieDataPoint;
var element = series.Children[i] as PiePointElement;
var legendItem = new LegendItem(element);
legendItem.Title = dataPoint.LegendTitle;
this.radChartView1.ChartElement.LegendElement.Items.Add(legendItem);
}
}
}
To reproduce: - Add DateTimeContinuousAxis to a chart and set its MajorStep property. Workaround: Create the DateTimeContinuousAxis in the code behind.
Until the feature gets implemented please use the suggested solution here: http://www.telerik.com/support/kb/winforms/details/integrating-panzoom-trackball-and-lassozoom-controllers-in-radchartview
When combining scalebreaks and series stacking, the rendered chart does not match the data. See attached solution: The bar of the category "1/2016" has a length of 105 (as indicated by the tooltips) -- but the corresponding axis labeling shows a value of 37. The scalebreak is off too (probably matching the wrong axis).
To reproduce:
- Enable the Trackball
- Use the following code:
public RadForm1()
{
InitializeComponent();
ScatterLineSeries sls = radChartView1.Series[0] as ScatterLineSeries;
sls.XValueMember = "X";
sls.YValueMember = "Y";
}
private void timer1_Tick(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("X", typeof(double));
dt.Columns.Add("Y", typeof(double));
Random ran = new Random();
for (int i = 0; i < 100; i++)
dt.Rows.Add(i, 1 + ran.NextDouble() / 10);
radChartView1.Series[0].DataSource = dt;
}
Workaround:
class MyChartTrackballController : ChartTrackballController
{
protected override string GetPointText(DataPoint point)
{
ChartSeries series = point.Presenter as ChartSeries;
if (series == null)
{
return string.Empty;
}
return base.GetPointText(point);
}
}
To reproduce:
- Set the palette from the default context menu.
- Try to get the palette name.
Workaround:
class MyChartDataPointElementController : ChartDataPointElementController
{
protected override RadContextMenu CreatePaletteMenu()
{
//return base.CreatePaletteMenu();
RadContextMenu menu = new RadContextMenu();
RadChartLocalizationProvider localizationProvider = RadChartLocalizationProvider.CurrentProvider;
RadMenuItem paletteItem = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.Palette));
menu.Items.Add(paletteItem);
RadMenuItem item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteArctic));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteAutumn));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteCold));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteFlower));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteForest));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteGrayscale));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteGround));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteLilac));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteMetro));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteNatural));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PalettePastel));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteRainbow));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteSpring));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteSummer));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteWarm));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteWindows8));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
item = new RadMenuItem(localizationProvider.GetLocalizedString(RadChartStringId.PaletteSun));
item.Click += new System.EventHandler(item_Click);
paletteItem.Items.Add(item);
return menu;
}
void item_Click(object sender, System.EventArgs e)
{
RadMenuItem item = sender as RadMenuItem;
if (item != null)
{
this.Area.View.Palette = ChartPalette.FromKnownPalette(item.Text);
this.Area.View.Palette.Name = item.Text;
}
}
}
Change the controller like this:
radChartView1.Controllers.Add(new MyChartDataPointElementController());
To reproduce:
public RadForm1()
{
InitializeComponent();
date = DateTime.Now;
}
int dayCounter;
Random rnd = new Random();
DateTime date;
Timer timer = new Timer();
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
LineSeries lineSeria = new LineSeries();
DateTimeContinuousAxis continuousAxis = new DateTimeContinuousAxis();
continuousAxis.LabelFormat = "{0:dd}";
lineSeria.HorizontalAxis = continuousAxis;
radChartView1.Series.Add(lineSeria);
for (int i = 0; i < 500; i++)
{
radChartView1.Series[0].DataPoints.Add(new CategoricalDataPoint(rnd.Next(1000), date.AddDays(dayCounter++)));
}
timer.Tick += timer_Tick;
timer.Interval = 200;
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
foreach (CategoricalDataPoint point in radChartView1.Series[0].DataPoints)
{
// point.Value = rnd.Next(1000);
point.Category = date.AddDays(dayCounter++);
}
}
Workaround:
void timer_Tick(object sender, EventArgs e)
{
DateTimeContinuousAxis continuousAxis = ((LineSeries)radChartView1.Series[0]).HorizontalAxis as DateTimeContinuousAxis;
HybridDictionary hashSet = typeof(Axis).GetField("hashSet", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(continuousAxis) as HybridDictionary;
hashSet.Clear();
}
To reproduce: - Show the legend and the add remove series at runtime. - The legend items must not have text.
To reproduce: - Add three line series and only set their point size. - At runtime remove the second series. - The points color is not updated corectly. Workaround - Set colors in code like this: lineSerie1.BorderColor = Color.Red; lineSerie1.BackColor = Color.Red; lineSerie2.BackColor = Color.Green; lineSerie2.BorderColor = Color.Green; lineSerie3.BackColor = Color.Blue; lineSerie3.BorderColor = Color.Blue;