This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
We recently purchased a site license but I am having trouble configuring the license. I created a new sample wpf project and added a user control in a separate library. I added a reference to the mindscape library and from the tool box I added a Mindscape chart. The project automatically generated a licenses.licx with Mindscape.WpfElements.Charting.Chart, Mindscape.WpfElements, Version=5.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxx and same entry for the rest of the controls. When I run it I get an exception {"No License Installed"}. However, if I include the user control into the main project it runs fine. The exception occurs only when the user control with the mindscape chart is in a separate library. Note that I had the trial version installed but I un-installed it prior to running the sample I created. Also the software that I've received from Mindscape does not include a setup file so I just copied the files over. Peter |
|
|
I got the license to work. Is there a way to drag and drop an alternative Y axis to make it primary? Thanks, Peter |
|
|
Hello Peter At the moment there is no drag and drop for moving the axes. Do you need this feature for the chart control itself (So users can change around the axes), or for the designer? -Jason |
|
|
Hi Jason, Yes, I need it for users to change around the axes and not for the designer. At the moment I allow users to right click on an alternative axis and display a menu otion (set main y axis). I swap them and it works well. However, if there is an easy way of doing the drag an alternative axis and drop it in the place where the main axis that would be nice. Thanks, Peter |
|
|
Hello Peter I have attached a sample that demonstrates a simple way to implement drag and drop that allows the user to drag an alternate axis and replace it with the main axis. In Window1.xaml I have a chart with 4 line series. 3 of them are mapped to alternate axes. I have set AllowDrop = true on the main axis and attached an event handler to the Drop event of the main axis. On the 3 alternate axes, I attach an event handler to the MouseLeftButtonDown and PreviewMouseMove events. MouseLeftButtonDown is just used to store the mouse down position which is used later to detect when a drag/drop operation has begun. The PreviewMouseMove method checks to see if a drag/drop operation can begin, and if so, calls DragDrop.DoDragDrop. The ChartAxis_Drop method is called when the mouse is dropped on the main axis. Here you can use whatever logic you want for swapping the dragged alternate axis with the main axis. I have taken the approach of removing the dragged alternate axis, and then adding a new alternate axis and a new main axis, then restoring the appropriate properties. I also make sure that the new main axis has AllowDrop = true, and the new axes have the appropriate event handlers. When you run the application you may notice 2 bugs: after performing a drag/drop operation, the main axis only displays the 0 label. And the drag/drop hit testing on the axis are not very good (can only drop on an axis label etc, but not the white space). These 2 bugs will be fixed in the next nightly builds available from around 1200GMT. Let us know if there are other details you need help with for implementing this drag and drop functionality. -Jason |
|
|
Nice job! Thanks, Peter |
|
|
I have one more question. Is there a way you can give the user control over the tickmarks. I have noticed the collection is read-only and I would like to be able to add or remove to the collection as the user zooms in. Thanks, Peter |
|
|
Hello Peter There is no way to manually add and remove tick marks from the axis. The axis should be automatically changing the number of tick marks based on the zoom. Could you give more details to the behaviour you want to achieve compared to what the chart is doing? Cheers -Jason |
|
|
Hi Jason, Basically as I zoom in I would like to keep the number of tick marks constant which works at the moment. However, I have noticed that if I zoom several times that the labels underneath the tick marks no longer adjust. I included two screen shots. One is desiredbehavior and actual behavior. Would it be possible to get the labels to adjust based on max, min and constant number of tickmarks? Thanks, Peter |
|
|
Hello Peter Are you referring to the X axis labels repeating the same number multiple times? If so, this is due to the LabelFormat. One option would be to always have the LabelFormat of the X axis to have one decimal place. Another option would be to monitor the range of the X axis and then change the LabelFormat property to include 1 decimal place when necessary. I don't plan to include this functionality into the chart just yet because the visual outcome of the labels will be different to the LabelFormat property value that developers set. This would be a change in behaviour. Let me know if I have misunderstood something. -Jason |
|
|
Hi Jason, Thanks for the reply. You understood correctly and it's working now up to 3 decimal points. Is it possible to go beyond 3 decimal points? Thanks, Peter |
|
|
Hello Peter Yes it is possible to go beyond 3 decimal places. The LabelFormat can support this, and the chart has virtually no limit in zoom. You'd only want to handle more than 3 decimal places if you data is really that detailed. If your data is not that detailed, you can set the MinimumRange property on the chart axes to limit how far in the user can zoom if you want. -Jason |
|