Page 1 of 1

Custom PointerStyle

Posted: Fri Jun 05, 2009 2:55 pm
by 9640703
Hello, Team!

We are using version 2.0 of TeeChart library for our WinForm application.
Is it possible to create custom PointerStyle in addition to values in PointerStyles enum. Actually i'm interested in semi-sphere figure.

If it's not possible then is it possible to distinguish points on the same line in some other way - for example with blur, glow, canvas or with other effects like this for version 2.0.

Tnanks!

Posted: Fri Jun 05, 2009 3:52 pm
by narcis
Hi gs,

Yes, you can implement your own series inheriting from existing Points series and changing its draw method, someting as in the example I posted here:

http://www.teechart.net/support/viewtopic.php?t=4309

Posted: Mon Jun 08, 2009 6:51 am
by 9640703
Thanks, quite helpful but actually I would like to see not another line with custom drawing (or pointer style)
but line with different styles based on "state" of the concrete point, something like this in pseudocode:

Code: Select all

private void GetPointerStyle(Steema.TeeChart.CustomPointSeries series, Steema.TeeChart.CustomPointSeries.GetPointerStyleEventArgs e)         
 {
    if (someCondition())
   {
      e.Style = PointerStyles.Triangle;
   }
   else
   {
      ApplyMyCustomStyleForPoint(e)
   }
 }
If it's possible to customize the appearance in some other way (with another effects), I would appreciate it.

Posted: Mon Jun 08, 2009 9:59 am
by yeray
Hi gs,

In v2009 there is ImagePoint series that would allow you to do something as follows:

Code: Select all

Image original;
private void InitializeChart()
{
    ImagePoint points1 = new ImagePoint(tChart1.Chart);
    points1.FillSampleValues(25);

    original = points1.PointImage;
    points1.GetImage += new GetImageEvent(points1_GetImage);
}

void points1_GetImage(CustomImagePoint sender, int valueIndex, Image image)
{
    if (valueIndex == 10)
    {
        ((ImagePoint)sender).PointImage = Image.FromFile(@"C:\temp\mypointer.jpg");
    }
    else
    {
        ((ImagePoint)sender).PointImage = original;
    }
}
In v2 I'm afraid that the only solution is to create your own series as NarcĂ­s pointed to you before because PointerStyles is an enum defined into the Steema.TeeChart.Styles namespace.