CustomCategoryAxis

Jul 17, 2012 at 2:16 AM

Hi Objo,

We have implemented a CutomCategoryAxis, which allows you specify the range of the labels, mainly to use with the RectagularBarSeries, but it also works well with LineSeries if you want to create custom regions.

Anyway, we had to create a new class to store label information, such as the Name, From value and To value.

class AxisLabel
{
    public string Name {get;set;}
    public double From {get;set;}
    public double To {get;set;}
}

You can can then add AxisLabels to the CustomCategoryAxis to have labels defined with custom start and end positions.

The question is, we think it is probably better to merge this into the CategoryAxis and refactor it. Since the CategoryAxis only takes a String[] of category names, we can assign "From" and "To" values to the AxisLabel based on the "TotalWidthPerCategory" values. What do you think?

This would also make it easier to add mouse events to the category axis and return the category range based on which label has been clicked. In fact is there a way of merging the AxisLabel with a TextAnnotation class?

Coordinator
Aug 8, 2012 at 10:37 PM

I'll add this to the issue tracker. Need to think more how (or if) this can be implemented.

See http://oxyplot.codeplex.com/workitem/9976