views:

30

answers:

1

Hi Community, I want to draw on a Flex AreaChart. This AreaChart has an AnnotationElement that is an CartesianDataCanvas. When I draw some items on this CartesianDataCanvas, the chart looks good when the item fits inside the chart. But when I draw an item that is bigger than the chart, the chart automatically resize and try to fit my item inside the chart. I dont want my chart to resize automatically like that, but rather not showing the item part lay outside the chart. What should I do?

Thank you a lot, Henry

A: 

what about scaling it manually?

before you draw it on the canvas, determine the sizes of AreaChart including width/percentWidth and same for height, and scale your graphics to fit the canvas/AreaChart.

If you want to do it right, research this canvas to next properties:

explicitMaxWidth and postLayoutTransformOffsets and this too setLayoutBoundsPosition () from documentation about AreaChart & CartesianDataCanvas

And let us know :)

Eugene
Thanks for your solution :)
Henry
Thanks for your solution :)I finally find out a way. There are so many properties and method associated with each Flex components, after searching around I found properties x and y of HitData object. I will my item based on that coordinators x and y.How do you get to know those properties like explicitMaxWidth? There are too many of them, the extends and implements hierarchy is also very complicated.
Henry
great choice Henry, if your graphic you drawing is really less than canvas sizes, in my answer I also proposed an idea how to fit it if it bigger than sizes of canvas. Anyway, I very like flex, and imho we could do anything we want using this platform )
Eugene