Chart Marks

edited 12:39PM in FastReport VCL
Hello everyone!

I'm trying to change mark colors using code:
TPieSeries(DiagJK.Series[0]).marks.color := clRed;
But it changes the color of all marks on my pie diagram.
How can I change the color of exact mark?

Comments

  • PolomintPolomint Australia
    edited 12:39PM
    G'day!

    Have you checked to see if this is covered in the TeeChart documentation?

    http://www.teechart.net/docs/teechart/vclfmx/tutorials/

    Cheers, Paul
  • edited January 2019
    Polomint wrote: »
    G'day!

    Have you checked to see if this is covered in the TeeChart documentation?

    http://www.teechart.net/docs/teechart/vclfmx/tutorials/

    Cheers, Paul

    Yep, I've read through that documentation. As explained there, I have to write smth like this in my code:
    DiagJK.Series[0].marks.item[2].color := clRed;
    
    But I'm getting an access violation at adress error.
    After that I found out that in FastReport I have to use this construction to get rid of that error:
    TPieSeries(DiagJK.Series[0]).marks.item[2].color := clRed;
    

    And now I'm getting unknown identifier:"item" error because I don't have this property in my TSeriesMarks class:
    b30f8e0667b5f7778c178dcc73e990bd.png
    So I don't see anything here that will help me to access the exact mark I need.
  • edited 12:39PM
    I was able to set the colors individualy like that:

    Chart1.SeriesData[0].XSource:= 'Val 1;Val 2;Val 3;Val 4';
    Chart1.SeriesData[0].YSource:= '10;20;40;80';
    Chart1.SeriesData[0].Source3:= 'clYellow;clRed;clBlue;clGreen';

    found previous here:

    http://www.fast-report.com/en/forum/?p=/discussion/11001
  • edited 12:39PM
    Simon_R wrote: »
    I was able to set the colors individualy like that:

    Chart1.SeriesData[0].XSource:= 'Val 1;Val 2;Val 3;Val 4';
    Chart1.SeriesData[0].YSource:= '10;20;40;80';
    Chart1.SeriesData[0].Source3:= 'clYellow;clRed;clBlue;clGreen';

    found previous here:

    http://www.fast-report.com/en/forum/?p=/discussion/11001

    That will change the color of pie sectors, not the marks. I need to change the color of exact mark\mark text on certain event using code.
  • PolomintPolomint Australia
    edited February 2019
    alfapf wrote: »
    I need to change the color of exact mark\mark text on certain event using code.
    Did you read the documentation I recommended? Simon_R's response should have pointed you in the right direction, too.

    The following link pointing to a specific page in the TeeChart documentation that shows you how to change properties for individual marks:

    http://www.teechart.net/docs/teechart/vclf...MarksItems.html
  • edited February 2019
    Polomint wrote: »
    Polomint wrote: »
    I need to change the color of exact mark\mark text on certain event using code.
    Did you read the documentation I recommended? Simon_R's response should have pointed you in the right direction, too.

    The following link pointing to a specific page in the TeeChart documentation that shows you how to change properties for individual marks:

    http://www.teechart.net/docs/teechart/vclf...MarksItems.html

    Yep, and I've posted the problem about it above. If I'm trying to access exact mark like this:
    DiagJK.Series[0].Marks[3]...
    
    I'm getting an "access violation" error. When I'm trying to access the mark like this:
    TPieSeries(DiagJK.Series[0]).Marks[3]...
    
    I'm getting an "class "TSeriesMarks" does not have default property" error.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.