Pie Charts


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: Pie Charts

  1. #1
    Join Date
    Jan 2008
    Posts
    29

    Pie Charts

    Elo guys, i'm developing a packet sniffing software! well actually that's mostly complete. I'm trying to implement some reporting tools like piecharts and graphs to show the amount application procotols being used. I need those reports in real time!!

    I'm using Chart2D_1.9.6k to implement those reporting tools. I have been able to implement a pie chart. i have created an empty dataset.
    The problem is that the state of the pie chart did not change even after data is added to it!! hmmm does it need to be refreshed somehow....!!

    Can anyone please help...!!!
    Thanks
    Last edited by null_guy; 03-09-2008 at 04:05 PM.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I found this. Does it help?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Jan 2008
    Posts
    29
    hmmm not much but thanks!!

    I have already implemented the pie chart in my GUI, i have already initialized the piechart thorugh its constructor and assigned default values for the different sectors.

    Now what i want is to "re-shap" the pie chart as more data comes in.....kinda of refreshing the state of the piechart each time an info is added.!!

    Can anyone HEEEEEEEEEEEEEEElp please.....!!!!

  4. #4
    Join Date
    Jan 2008
    Posts
    29
    Hey guys, i'm using JFree_graph to implement a graph.
    i have modified the original soucre code to implement a thread and eventually got errors.

    Can anyone take a look at the above code please!!!
    thanks!
    Last edited by null_guy; 03-12-2008 at 04:11 PM.

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    That is just a whole lotta code to go through.

    What errors did you get and what lines of code caused the errors?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  6. #6
    Join Date
    Jan 2008
    Posts
    29
    The error

    Entering Thread
    Now = Wed Mar 12 14:58:16 EET 2008
    Entering Thread
    Now = Wed Mar 12 14:58:17 EET 2008
    Entering Thread
    Now = Wed Mar 12 14:58:17 EET 2008

    Exception in thread "Thread-2" org.jfree.data.general.SeriesException: You are attempting to add an observation for the time period Wed Mar 12 14:58:17 EET 2008 but the series already contains an observation for that time period. Duplicates are not permitted. Try using the addOrUpdate() method.
    at org.jfree.data.time.TimeSeries.add(TimeSeries.java:497)
    at org.jfree.data.time.TimeSeries.add(TimeSeries.java:526)
    at newGraph.captureData(newGraph.java:162)
    at newGraph$1.run(newGraph.java:187)
    at java.lang.Thread.run(Unknown Source)
    Some points(3 points) have been plotted then the error occurs as shown above.

    The error occurs at line 162.
    series.add(new Millisecond(), lastValue);

  7. #7
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by Error
    You are attempting to add an observation for the time period Wed Mar 12 14:58:17 EET 2008 but the series already contains an observation for that time period. Duplicates are not permitted.
    If you don't add duplicates does it work?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  8. #8
    Join Date
    Jan 2008
    Posts
    29
    hmmmm nop! no duplication at all!!!
    I have been able to solve the problem by using another method!!

    Thanks for the help!!

  9. #9
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by null_guy
    hmmmm nop! no duplication at all!!!
    I have been able to solve the problem by using another method!!

    Thanks for the help!!
    Please post what you did as it could help someone else with the same or similiar problem.

    Thanks.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  10. #10
    Join Date
    Jan 2008
    Posts
    29
    Instead of series.add(new Millisecond(), lastValue);

    i have replaced the add method with addOrUpdate :
    series.addOrUpdate(new Millisecond(), lastValue);

    and when the thread starts to run... the graph is plotted with no errors!!!!

  11. #11
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Thank you null_guy. As I said, hopefully others will find your solution beneficial.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 2
    Last Post: 08-16-2003, 12:02 PM
  2. DoCmd.OutputTo to open/save .snp file with charts
    By Natasha Korobova in forum VB Classic
    Replies: 0
    Last Post: 07-10-2003, 02:25 PM
  3. Replies: 1
    Last Post: 06-28-2002, 11:39 AM
  4. Using charts in ASP pages
    By rd in forum ASP.NET
    Replies: 2
    Last Post: 07-23-2001, 01:56 AM
  5. Pie chart problem in MS Access97/MS Graph 2000 Cha
    By art mohr in forum VB Classic
    Replies: 0
    Last Post: 06-21-2001, 06:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center