ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Dropping label on "aggregates data labels"
Posted by Daniel on Jun-25-2021 01:47
Attachments:
Hi Peter,

We have a pretty plain and simple histogram that conveys zero values, both at the beginning and and end X axis values and possibly some inside. We just used SetAggregateLabelStyle to get these values.

Great.. It works well! However, we would like to drop these zero values at both ends of the axis...

We could possibly drop the "setAggregateLabelStyle" stuff and add them programmatically via some sort of "addText" loop.

Is there a smarter CD way to discount these "0" values at both ends, whilst retaining the internal 0 values - blue in the sample?

Daniel
disable zero values in histogram.png

  Re: Dropping label on "aggregates data labels"
Posted by Peter Kwan on Jun-25-2021 11:22
Hi Daniel,

Yes, you can use Layer.addCustomAggregateLabel.

https://www.advsofteng.com/doc/cdnet.htm#Layer.addCustomAggregateLabel.htm

I am not sure which programming language you are using, so I will just C# as an example is:

for (int i = 0; i < myData.Length; ++i)
{
    // Display labels if they are not zero and within 3 bars from the end points
    if ((myData[i] != 0) || (i >= 3) || (i < myData.Length - 3))
         myBarLayer.addCustomAggregateLabel(i, "" + myData[i], "Arial", 10, 0x333333);
}

The "if" is the condition under which the labels should be displayed. You can modify it to fit you need.

Regards
Peter Kwan

  Re: Dropping label on "aggregates data labels"
Posted by Daniel on Jun-25-2021 17:18
Hi Peter,

Thanks for the great forum and your fast answers. Always to the point!

Daniel

PS: I am using the COM-based edition and looking forward to get the coming 7.0 edition. Great news these CDML enhancements (rounded borders and grammar available for legend items)! I also definitely appreciate that fonts can be called by names.

  Re: Dropping label on "aggregates data labels"
Posted by Peter Kwan on Jun-25-2021 19:06
Hi Daniel,

I just want to get some usage statistics. Are you using the COM edition for desktop or web (ASP) application?

Regards
Peter Kwan

  Re: Dropping label on "aggregates data labels"
Posted by Daniel on Jun-25-2021 19:35
Hi Peter,

Are you using the COM edition for desktop or web (ASP) application?
Using the COM edition for desktop. Looking forward to pursue later next year onto the python version. Thanks for the python stuff. This large platform support is really comfortable to work with!

Regards from Paris, Daniel