Hi,
I've created a line chart, but need to print it out. These means I need to use Icons in the Legend
rather than colored boxes. And for the icons in the Legend to match the icon that mark the data points
on the Line.
I saw a post that uses a scatter chart to achieve the effect but it seems the scatter chart requires X and Y to be numerical
and my X vaules are text.
Thanks in advance
Although you can easily add icons to each line using the LineChart.LineAppearances collection, the legend is still only capable of showing colored boxes.
The best way to solve that problem is to handle the FillSceneGraph event, find those colored boxes in your legend, and replace them with Symbols at the same location.
Thanks, I suspected as much. i was'nt sure whether a 'primitive' could be re-created as a different type...or would I just hide the boxes and draw icons over the top?
you can use the setter in e.SceneGraph to replace the primitive...
e.SceneGraph[n] = new Symbol();
or you can set the PE to transparent on the old primitive and then add the new one...
e.SceneGraph[n].PE.FillOpacity = 0;
e.SceneGraph.Add(new Symbol());
or you can remove the old primitive and add the new one.
e.SceneGraph.Remove(old);
e.SceneGraph.Add(new);
Thanks
I am also having the Same Problem . I am new to Infragistics .Can u please post the code that you Achieved.
void
sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e ) { System.Collections.
{
System.Collections.
( );
e.SceneGraph ) {
type = p.GetType( );
) {
) & p.Row >= 0 ) { boxes.Add( p ); } } }
boxes.Add( p );
}
boxes ) {
// draw a circle, horizontally & vertically centered in the Box.
circleCenterX, circleCenterY; circleCenterX = b.rect.X + ( b.rect.Width / 2 ); circleCenterY = b.rect.Y + ( b.rect.Height / 2 ); Infragistics.UltraChart.Resources.Appearance.LineAppearance appearance = ( sender
circleCenterX = b.rect.X + ( b.rect.Width / 2 );
circleCenterY = b.rect.Y + ( b.rect.Height / 2 );
Infragistics.UltraChart.Resources.Appearance.LineAppearance appearance = ( sender
UltraChart ).LineChart.LineAppearances[ b.Row ]; Infragistics.UltraChart.Shared.Styles.SymbolIcon icon = appearance.IconAppearance.Icon;
Infragistics.UltraChart.Shared.Styles.SymbolIcon icon = appearance.IconAppearance.Icon;
ch = appearance.IconAppearance.Character;
( icon != Infragistics.UltraChart.Shared.Styles.SymbolIcon.Character ) { Symbol myCircle =
Symbol myCircle =
( circleCenterX, circleCenterY ), icon, Infragistics.UltraChart.Shared.Styles.SymbolIconSize.Medium ); myCircle.drawColor =
myCircle.drawColor =
.Black; myCircle.PE = b.PE;
myCircle.PE = b.PE;
// turn off tooltips for the Box and turn them on for myCircle.
b.Caps = PCaps.None;
b.Visible =
; myCircle.Caps = PCaps.Tooltip | PCaps.HitTest; myCircle.Chart = b.Chart; ; myCircle.Value = b.Value; myCircle.Row = b.Row; myCircle.Column = b.Column; myCircle.Layer = b.Layer;
myCircle.Caps = PCaps.Tooltip | PCaps.HitTest;
myCircle.Chart = b.Chart;
;
myCircle.Value = b.Value;
myCircle.Row = b.Row;
myCircle.Column = b.Column;
myCircle.Layer = b.Layer;
// add the circle to the scene.
e.SceneGraph.Add( myCircle );
else
Infragistics.UltraChart.Core.Primitives.Text text =
[ ] { ch } ) ); text.drawColor =
text.drawColor =
.Black; text.labelStyle.Font = appearance.IconAppearance.CharacterFont; text.PE = b.PE; text.bounds = b.rect;
text.labelStyle.Font = appearance.IconAppearance.CharacterFont;
text.PE = b.PE;
text.bounds = b.rect;
; text.Caps = PCaps.Tooltip | PCaps.HitTest; text.Chart = b.Chart; ; text.Value = b.Value; text.Row = b.Row; text.Column = b.Column; text.Layer = b.Layer;
text.Caps = PCaps.Tooltip | PCaps.HitTest;
text.Chart = b.Chart;
text.Value = b.Value;
text.Row = b.Row;
text.Column = b.Column;
text.Layer = b.Layer;
// add the text to the scene.
e.SceneGraph.Add( text );