Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1272 - Force Label at beginning of Axis irrespective of Increment limitations
Summary: Force Label at beginning of Axis irrespective of Increment limitations
Status: CONFIRMED
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Axes (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-17 06:28 EDT by marc meumann
Modified: 2015-08-17 06:28 EDT (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marc meumann 2015-08-17 06:28:08 EDT
The OnAxis property enables/disables first/last Axis label for regularly incremented labels. This is something slightly different....

To oblige the placement of a first label, to coincide with the minimum axis value, irrespective of it's validity in relation to the Axis' own increment settings.

Effect can be seen with this workaround code:

=========================
using Steema.TeeChart;
using System.Reflection;

private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
    //set x position for new label
    int x = tChart1.Axes.Bottom.CalcPosValue(tChart1.Axes.Bottom.Minimum);

    //tChart1.Axes.Bottom.Labels.position (here the Label y coordinate) is protected so need alternative technique for y...
    AxisLabels tmpLabels = new AxisLabels(tChart1.Axes.Bottom);
    FieldInfo privateField = tmpLabels.GetType().GetField("position", BindingFlags.NonPublic | BindingFlags.Instance);
    int y = (int)privateField.GetValue(tChart1.Axes.Bottom.Labels);

    string label = tChart1.Axes.Bottom.Minimum.ToString("#");

    //output text
    g.TextOut(x - ((int)Math.Round(g.TextWidth(label) / 2)), y, label);
}
=========================