Jump to content
Software FX Community

TPS

Members
  • Posts

    1
  • Joined

  • Last visited

TPS's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. TPS

    Dragging the Plot

    I'm trying to create a feature that allows me to move the time window (the x-axis type is Time) of the chart busing the mouse, by click and drag. I guess this is a little similar to the scrolling feature of the Windows.Forms version, but "iPhone style" instead of using a scrollbar. But I have stumbled upon a few problems: In order to move the time window i need to convert the mouse location to a value of the type used by the x-axis. I get that like this:HitTestResults htr = Chart.HitTest(mousePoint); Point mousePos = htr.PositionRelativeToPlotArea; Chart.AxisX.PixelToValue(mousePos.X); The problem here is that the PositionRelativeToPlotArea returns (0, 0) if the cursor is outside the plot area. Why not just let it return negative values and values that exceeds the boundries of the plot? Or is there another way to get value outside the x-axis min/max range? I would like the cursor to be a hand to indicate that the feature is present, but methods I've come up with don't work:<Style TargetType="{x:Type cfx:PlotAreaAttributes}"> <Setter Property="Cursor" Value="Hand" /> </Style> and <cfx:Chart x:Name="myChart> <cfx:Chart.PlotArea> <cfx:PlotAreaAttributes Cursor="Hand" /> </cfx:Chart.PlotArea> </cfx:Chart> Or am I'm perhaps going all wrong about it?
×
×
  • Create New...