Jump to content

 

Photo
* * * * * 2 votes

Selection by "zooming"


  • Please log in to reply
26 replies to this topic

#1 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 24 February 2012 - 01:20 PM

Hello, I like visifire charting for silverlight and I have a question is it possible to implments such a thing:

http://desmond.image....jpg&res=medium

#2 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 24 February 2012 - 01:56 PM

Hello Vmachacek,

Yes you can create a UserControl or a CustomControl and add Visifire Chart inside it. Now on ValueChanged event of your selection control collect min and and max value and call Zoom(minVal, maxVal) api of y-axis to zoom the main chart.
Regards,
Eva

#3 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 25 February 2012 - 12:11 AM

Hello Vmachacek,

Yes you can create a UserControl or a CustomControl and add Visifire Chart inside it. Now on ValueChanged event of your selection control collect min and and max value and call Zoom(minVal, maxVal) api of y-axis to zoom the main chart.


yeah, I was interested if anybody did same thing, or is there any existing use case.

#4 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 27 February 2012 - 06:51 AM

Hey Vmachacek,

Few months ago I worked on a similar control. Well, I will be creating a sample app for you. I will get back to you soon.
Regards,
Eva

#5 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 27 February 2012 - 12:36 PM

Hey Vmachacek,

Few months ago I worked on a similar control. Well, I will be creating a sample app for you. I will get back to you soon.



Thats very nice from you eva, I was thinking of using range slider from this page http://mightymeaty.m...ht.silverlight/ its open source, so easy to adjust with Visifire.

#6 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 28 February 2012 - 08:13 AM

Hi vmachacek,

It looks similar to my application. Yes you can also work with the available range control from here.
Regards,
Eva

#7 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 28 February 2012 - 12:38 PM

Hi vmachacek,

It looks similar to my application. Yes you can also work with the available range control from here.



Well, If you have any functional code which I can reuse that would be fine, otherwise I can build custom control with SL toolkit line chart (to make ti more universal) and in the top of this chart put range slider from link mentioned above. And I think that would be nice range picker based on some sort of trend projected to graph. If you want I can share result with you. Let me know if you can send me your code, or I should start building my own chart-date-range-picker

#8 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 29 February 2012 - 02:38 PM

Hi vmachacek,

Tomorrow I will share my code with you.
Regards,
Eva

#9 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 01 March 2012 - 02:00 PM

Hi Vmachacek,

Posted Image

See the live example: http://www.visifire....ngeBarDemo.html

Download the sample code here from Visifire ExampleArea.

This sample code works with the latest internal release v4.5.3-0_b and above. You can download the internal build visifire_v4.5.3-0_b from here. This version will be released by the end of this week.

Attached Files


Regards,
Eva

#10 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 01 March 2012 - 05:40 PM

Hi Vmachacek,

Posted Image

See the live example: http://www.visifire....ngeBarDemo.html

Download the sample code here from Visifire ExampleArea.

This sample code works with the latest internal release v4.5.3-0_b and above. You can download the internal build visifire_v4.5.3-0_b from here. This version will be released by the end of this week.


This is AWESOME! Thank you so much. You saved me loads of time! Thanks again ; )

#11 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 01 March 2012 - 10:43 PM

Can I ask you one more thing: Do it bindable both ways, If I change binded DateTime instance to change control accordingly. DependencyProperty supports that, but you know that of course..

#12 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 06 March 2012 - 06:36 AM

Do it bindable both ways, If I change binded DateTime instance to change control accordingly.

Can you explain more on this? Can you explain me exactly what you are trying to achieve in detail.

Note: I have already introduced few new Dependency Properties (Maximum, Minimum ...etc). You can download the latest version from the link below.
http://www.visifire.com/silverlight_examples_details.php?id=32
Regards,
Eva

#13 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 06 March 2012 - 12:43 PM

Can you explain more on this? Can you explain me exactly what you are trying to achieve in detail.

Note: I have already introduced few new Dependency Properties (Maximum, Minimum ...etc). You can download the latest version from the link below.
http://www.visifire.com/silverlight_examples_details.php?id=32



I had in mind If I have DateTime instance binded to that ValueFrom or ValueTo dependency properties and change that DateTime instance by other logic than user control I want reflect this change in user control. Do you know what I mean? Like enable 2 way binding, reading values from control and setting data into control thru binded instance.

#14 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 07 March 2012 - 12:18 PM

If you look at the code in RangeBar.xaml.cs you will find that FromValue and ToValue Properties are defined as

        /// <summary>
        /// Identifies the Visifire.Controls.RangeBar.ToValue dependency property.
        /// </summary>
        /// <returns>
        /// The identifier for the Visifire.Controls.RangeBar.ToValue dependency property.
        /// </returns>
        public static readonly DependencyProperty ToValueProperty = DependencyProperty.Register
            ("ToValue",
            typeof(Object),
            typeof(RangeBar), null);

        /// <summary>
        /// Identifies the Visifire.Controls.RangeBar.FromValue dependency property.
        /// </summary>
        /// <returns>
        /// The identifier for the Visifire.Controls.RangeBar.FromValue dependency property.
        /// </returns>
        public static readonly DependencyProperty FromValueProperty = DependencyProperty.Register
            ("FromValue",
            typeof(Object),
            typeof(RangeBar), null);

So you need to add few lines of code for property change callback. On FromValue and ToValue property change you need to update the RangeBar UI. Done!

Below are the functions which updates the RangeBar UI

  • PositionLeftAndRightThumb();
  • RenderLabels();
  • UpdateLeftThumbVisual();
  • UpdateRightThumbVisual();

Regards,
Eva

#15 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 07 March 2012 - 04:09 PM

Can you create working sample? I get into value null errors and I dont really understand whats happening under the hood.

#16 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 09 March 2012 - 04:18 AM

Updated! Download it from Visifire Example Area .

Download Link: http://www.visifire....tails.php?id=32
Regards,
Eva

#17 vmachacek

vmachacek

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 March 2012 - 11:59 AM

Updated! Download it from Visifire Example Area .

Download Link: http://www.visifire....tails.php?id=32



Awesome!! Thanks a lot!

#18 Xusan

Xusan

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 April 2012 - 10:14 AM

Hi Eva
Thanks for RangeBar control, I'd love to use it in my project however I didn't able to use it with numeric X axis, can you look at source code again please to make sure it can work with numeric values

Thanks

#19 Xusan

Xusan

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 20 April 2012 - 11:24 AM

Generaly I'm trying to use it with MultiChart binding http://www.visifire....?showtopic=3002 , and currently not able to get it work..

#20 Eva

Eva

    Advanced Member

  • Members
  • PipPipPip
  • 365 posts
  • Gender:Female

Posted 23 April 2012 - 06:10 AM

Hey Xusan,

Range bar works with both Numeric and DateTime axis. Well, today evening I will look into my code and see if there any problem with Numeric axis. I will get back to you soon.
Regards,
Eva




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users