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 8921079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:26:35+00:00 2026-06-15T06:26:35+00:00

I have 20 milliion rows in my table.I am trying to plot graph for

  • 0

I have 20 milliion rows in my table.I am trying to plot graph for timestamp using http://www.jqplot.com/tests/date-axes.php (date vs time) how will jquery handle so much of data to plot it. Two questions:

1.How can I construct an array from the below code:

line1=[['2008-09-30',4], ['2008-10-30',6], ['2008-11-30',5], ['2008-12-30',9], ['2009-01-30',8]];`

2.How can I improvize the code in this case:

def get_data(request):
 cdr = Cdr.objects.values_list('start_of_call',flat=True)
 context_instance=RequestContext(request, {})) 
 return render_to_response('cdr/get_data.html', context_instance=RequestContext(request, {'cdr':cdr}))

template:

<script class="code" type="text/javascript">
$(document).ready(function(){

{% for c in cdr %}
  {{ c|date:"d M Y"}}
{% endfor %}
 How to construct the below array line from for loop or using jquery methods
//var line1=[['2008-09-30',4], ['2008-10-30',6], ['2008-11-30',5], ['2008-12-30',9], ['2009-01-30',8]];

var plot1 = $.jqplot('chart1', [line1], {
title:'Default Date Axis',
axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
});
});
 </script>

EDIT

  line1=[['2008-09-30',4], ['2008-10-30',6], ['2008-11-30',5], ['2008-12-30',9], ['2009-01-30',8]];`

In the above line 4,6,5,9,8 are the hours

EDIT2

CDR values:

    [datetime.datetime(2012, 9, 13, 15, 54, 52, tzinfo=<UTC>), datetime.datetime(2012, 9, 22, 18, 24, 18, tzinfo=<UTC>), datetime.datetime(2012, 9, 6, 7, 42, 50, tzinfo=<UTC>), datetime.datetime(2012, 9, 7, 21, 27, 13, tzinfo=<UTC>), datetime.datetime(2012, 9, 3, 11, 57, 9, tzinfo=<UTC>), datetime.datetime(2012, 9, 1, 17, 23, 41, tzinfo=<UTC>), datetime.datetime(2012, 9, 15, 6, 14, 33, tzinfo=<UTC>), datetime.datetime(2012, 9, 4, 5, 36, 30, tzinfo=<UTC>), datetime.datetime(2012, 9, 17, 10, 45, 6, tzinfo=<UTC>), datetime.datetime(2012, 10, 1, 3, 1, 17, tzinfo=<UTC>), datetime.datetime(2012, 9, 27, 8, 36, 41, tzinfo=<UTC>), datetime.datetime(2012, 9, 30, 3, 12, 18, tzinfo=<UTC>), datetime.datetime(2012, 9, 18, 4, 8, 49, tzinfo=<UTC>), datetime.datetime(2012, 9, 2, 7, 21, tzinfo=<UTC>), datetime.datetime(2012, 9, 19, 16, 57, 34, tzinfo=<UTC>), datetime.datetime(2012, 9, 17, 17, 14, 49, tzinfo=<UTC>), datetime.datetime(2012, 9, 1, 22, 40, 33, tzinfo=<UTC>), datetime.datetime(2012, 9, 15, 1, 7, 39, tzinfo=<UTC>), datetime.datetime(2012, 9, 22, 17, 11, 45, tzinfo=<UTC>), datetime.datetime(2012, 9, 10, 3, 16, 21, tzinfo=<UTC>), '...(remaining elements truncated)...']
  • 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-15T06:26:36+00:00Added an answer on June 15, 2026 at 6:26 am

    something like this:

    from django.utils import simplejson
    
    def get_data(request):
        cdr = [(x.strftime('%Y-%M-%D'), x.hour) for x in \
                Cdr.objects.values_list('start_of_call',flat=True)]
        return render_to_response('cdr/get_data.html',
                                  {'cdr': simplejson.dumps(cdr)},
                                  context_instance=RequestContext(request))
    

    The format string in strftime might be a bit off – check it here: http://docs.python.org/2.7/library/datetime.html#strftime-strptime-behavior

    by the way your view did some weird things with RequestContext – the above is the more usual style.

    template:

    line1 = jQuery.parseJSON({{ cdr }})
    

    As for issues with sample size – there’s no clear answer – it’s going to depend on your network connection, your browser and machine. That siad 20M is very big – consider sampling the dataset to bring it down to a more manageable size – experimentation is going to be the best way.

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

Sidebar

Related Questions

I have a table containing 60 million rows. The structure is like entryid, date,
Ok, I have 2 million rows. Each has a billing date. i'm trying to
I have 1 million rows in MySql table temp and wish to multiply column
I have a table with 1.5 million rows. I run a query which fetches
I have a table with ~200 million rows and ~15 columns in it. I
I have a table with around 40 million rows, and I want to run
We have a large table (450 million rows containing 34 columns of numeric or
I have a items table with 1 million rows and a users table with
I have a large table with around half a million rows which is taking
I have a very large table of over 9 million rows and in my

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.