0

I'm using a Flex ColumnChart with a custom dataTipRenderer. I'm able to apply a nice skin with the dataTipRenderer, but am not sure how to move the datatip to be centered.

Is there a way to have the chart center the data tips over the column instead of the normal top-right alignment the chart does?

Instead of:

      |tip text|
    +++
    +++
    +++
    +++
    +++
    +++
    +++
    +++

I want:

| tip text |
    +++
    +++
    +++
    +++
    +++
    +++
    +++
    +++

Any ideas involving HitData, etc, would be welcome.

stevedbrown
  • 8,862
  • 8
  • 43
  • 58

1 Answers1

1

If you have a dataTipRenderer you can set the property x in the main component (canvas, hbox or vbox) like this: x="this.x - (this.width* .5)"

arno
  • 128
  • 2
  • That just sort of shifts the same issue to the left a bit. It's right more of the time, but doesn't work at the right edge. – stevedbrown Jun 25 '09 at 14:02
  • i'm not really sure what you want. But the way i'm doing it you can place the dataTip everywhere you want. y property you can set the y position. It is as simple as that. – arno Jun 25 '09 at 14:22
  • My bad I see what you mean now. I tested my code on a linechart but on a bar chart it's refusing to work – arno Jun 25 '09 at 14:25
  • Your solution works if the chart's container has enough room on the right side for the tip to be displayed. I didn't leave enough padding in the canvas. Pretty simple. – stevedbrown Jul 01 '09 at 18:29