Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
XamChart Crosshairs.GraphY
posted

Hi, i need your help!!!!

Currently i´m developing a user control, which consists of a XamChart, where I get the value of Crosshairs.GraphY, but always returns 0.0, when the XamWebChart on Silverlight if you return the value to be, exists a problem with this property?

This is to do a Drag & Drop column, i'm repeat on Silverlight  works right, but on WPF not

Sample of my code:

XAML

<igCA:XamChart HorizontalAlignment="Stretch" Name="xamWebChart1" VerticalAlignment="Stretch" Width="Auto" MouseMove="xamWebChart1_MouseMove" MouseDown="XamChart1_MouseDown" MouseUp="xamChart1_MouseUp" />

------------

xaml.cs

private

 

 

 

 

 

 

 

private void xamChart1_MouseUp(object sender, MouseButtonEventArgs e)

{

ShapeToNull();

 

 

if (_tmpStock == null)

 

 

return;

 

 

}

 

 

 

private void ShapeToNull()

{

 

 

if (_shape != null)

{

_shape =

 

null;

TextBlockColumnValue.Opacity = 0;

Cursor =

 

null;

}

}

Thanks and if you need more info about the case, let me know.

Regards.

 

 

private void XamChart1_MouseDown(object sender, MouseButtonEventArgs e)

{

_shape =

 

this.xamWebChart1.HitTest(e);

Cursor =

 

Cursors.SizeNS;

 

 

var webChart = (XamChart)sender;

 

 

var index = 0;

 

 

foreach (var serie in webChart.Series)

{

 

 

DataPoint dp = _shape.SelectedObject as DataPoint;

 

 

if (dp != null)

{

 

 

/*string _nameof = dp.Name;

double _valueof = dp.Value;*/

 

 

 

index = serie.DataPoints.IndexOf(dp);

 

 

 

if

(index > -1)

{

_tmpStock = _stockViewModelFiltered.SumarizedStocks[index];

 

 

 

var names = serie.DataMapping.Split(new char[] { ';', '=', ' ' }, StringSplitOptions

.RemoveEmptyEntries);

_tmpColumnName = names[3];

 

 

 

break

;

}

}

}

 

 

 

 

}

 

 

private

 

 

void xamWebChart1_MouseMove(object sender, MouseEventArgs e)

{

 

 

if (_shape != null)

{

 

 

DataPoint dp = _shape.SelectedObject as DataPoint;

 

 

var xamWebChart = (XamChart)sender;

 

 

 

var graphY = xamWebChart.Crosshairs.GraphY; <-- Here return 0.0

dp.Value = graphY;

 

 

 

 

 

TextBlockColumnValue.Text = ((

 

 

int

)graphY).ToString();

TextBlockColumnValueTranslateTransform.X = e.GetPosition(

 

 

this

).X - 40;

TextBlockColumnValueTranslateTransform.Y = e.GetPosition(

 

 

this

).Y;

TextBlockColumnValue.Opacity = _opacity;

}

 

 

 

else

{

TextBlockColumnValue.Opacity = 0;

}

}

 

HitTestArgs _shape;

Parents
No Data
Reply
  • 17605
    posted

    Hi,

    Have you tried enabling the Crosshairs:

    <igCA:XamChart>

                <igCA:XamChart.Crosshairs>

                    <igCA:Crosshairs Enabled="True" />

                </igCA:XamChart.Crosshairs>

Children
No Data