Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8681589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:32:58+00:00 2026-06-12T21:32:58+00:00

How to combine simple d3.js chart (for example http://bl.ocks.org/2579599 ) with jQuery.ui range slider?

  • 0

How to combine simple d3.js chart (for example http://bl.ocks.org/2579599) with jQuery.ui range slider?
With this slider I’d to control x-axis scale (begging and end of data series). I expect that my chart will contain large data set and ideally it should be done without redrawing the whole chart.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:32:59+00:00Added an answer on June 12, 2026 at 9:32 pm

    If you do not mind redrawing the points, then controlling the beginning and end of the x-axis with a scale can be achieved by changing the domain of x in the callback methods of the jQuery range slider.

    To make this pretty you can do this using a transition and by adding a clipping rectangle.
    The range slider callbacks would look something like this:

    <div id="slider">
      <script>
        $(function() {
          $( "#slider" ).slider({
            range: true,
            min: 0,
            max: data.length-1,
            values: [0,6],
            slide: function( event, ui ) {
              var maxv = d3.min([ui.values[1], data.length]);
              var minv = d3.max([ui.values[0], 0]);;
    
              //this is the main bit where the domain of x is readjusted
              x.domain([minv, maxv-1]);
    
              //apply the change in x to the x-axis using a transition
              graph.transition().duration(750)
                .select(".x.axis").call(xAxis);
    
              //apply the change in x to the path (this would be your svg:path)
              graph.transition().duration(750)
                .select(".path").attr("d", line(data));
          }});
        });
      </script>
    </div>
    

    I added this together with the clipping to get bl.ocks.org/3878029. Is this the kind of scaling of the x-axis that you imagined? It does redraw the path and the x-axis but I am not sure how you can avoid redrawing that seeing how you want it to change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this example http://jsbin.com/ipasu3/4/ When you click on a div code it hides
i'm trying to combine $regex and $in to do simple search. For example I
Consider this simple program: private static void Main(string[] args) { var directoryName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
Is there a built-in php function, or a simple (efficient!) way to combine built-in
To combine stderr and stdout into the stdout stream, we append this to a
Is it possible to combine a normal class with a partial class like this:
How can I combine this two selectors: $(td.listas select:last option:selected) This doesn't work! What
Really simple question, how do I combine echo and cat in the shell, I'm
HI, I am working on a simple class to combine items of any type...
Can people recommend quick and simple ways to combine the hash codes of two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.