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

  • Home
  • SEARCH
  • 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 9009919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:19:31+00:00 2026-06-16T02:19:31+00:00

I have a graph that is properly generated when the page loads. That code

  • 0

I have a graph that is properly generated when the page loads. That code is:

<body>
<div id="placeholder" style="width:800px;height:400px;"></div>

<script type="text/javascript">
$(function () {
    $.plot($("#placeholder"),
[ { data: %s } ],
{ xaxes: [ { mode: 'time' } ],
  yaxes: [  ] })
});
</script>

Which works fine. I have a button that executes jquery and makes a request to get a new json data structure. I’ve validated that the json being returned is indeed proper json. I’m attempting to graph the result with:

<script type="text/javascript">
$(function() {
      $("#button").click( function()
           {
             //alert('button clicked');
             $.ajax({
                url:  '/graph',
                type: 'POST', 
                dataType: 'html',
                data: {
                    start_date: $('#start_date').val(),
                    end_date  : $('#end_date').val(),
                    ticker    : $('#ticker').val()
                },
                success: function(result) {
                var placeholder = $("#placeholder");
                $.plot(placeholder,
                  [ { data: result } ], 
                    { xaxes: [ { mode: 'time' } ],
                      yaxes: [  ] });  
             }
            });
          }
      );
});

Which redraws the graph, but it’s empty and the y-axes is the default -1.0 through 1.0 and the x-axes is a single time entry of 00:00:00.

I’ve tried to use the setData() and draw() method calls but they don’t fix the issue.

There are no javascript errors being thrown as shown by firebug.
So, what am I doing wrong?

TIA!

  • 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-16T02:19:32+00:00Added an answer on June 16, 2026 at 2:19 am

    Are you sure the response is valid? Your dataType is ‘html’, so unless you’re doing something with a script tag, then the response is just a string. If you’re returning JSON directly, then you need to use dataType ‘json’.

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

Sidebar

Related Questions

I have the following graph that I generated using ggplot2 I had finalPlot as
I currently have a DirectShow.NET graph that properly plays but I would like it
I have a graph that contains nodes (groups) composed by inner nodes and when
Here's my situation. I have a graph that has different sets of data being
I have a graph library that I use to plot some data. This data
I have an unweighted directed graph that may or may not have cycles in
I have a d3 force-directed graph that contains a group of nodes: var node
I have an undirected graph on matris by vertex adjacency relations like that; /*
I have an app that uses the Graph API to post activity to a
I have created an application that creates bar graph based on inputs read from

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.