Kirill Bondar 10/18/2011 4:59:04 PM I'll try to outline the algorithm:
Simple Bars/Columns and Area charts have single value per data axis cell. In this case, first we try to fit the value in a colored area. If there is not enough space, we try to fit it outside of colored area. Since there is usually enough room in either place, we'll likely to display the value in any case.
Grouped Bars/Columns/Areas consist of multiple values per cell. In this case to have connection between the painting and the data we are trying to display the value in a related colored area. If there is not enough space the value is not displayed.
Lines display values in a Simple and Cumulative mode only - above or below the data point. In Grouped modes values are not displayed at all: there is no clear connection between the value and the data point, especially when data points are close to each other.
Pies and Doughnuts always display the value in a legend - there is enough space in any case.
----
"Not to display values" would be easy - indeed, this is merely a flag and charts are ready for this.
Displaying totals is applicable to a "Stacked" chart types only.
With "display all values" or "display totals" we are running into the same "lack of space" problem. While in Excel you set up charts based on relatively static data set and then you can adjust the position of each label to create readable view, in TeamDesk the data is highly dynamic. Depending on filter conditions and access rights the same view can display quite different results.
Perhaps the solution may reside in quite different area. So far charts are rendered as an image with no interactivity at all. Yet, all recent browsers support rendering of scalable vector graphics (SVG) format - and this one is interactive. If we change chart rendering code to support SVG we'll be able to display values as a tooltip if there is a lack of space. The drawback - it is not supported by old browsers in use and by e-mail clients - there we should still render charts as images.
|