Document or guide needed for creatine new Chart Types
Document or guide needed for creatine new Chart Types
Hi All,
I want to create a timing diagram extending JFreeChart. Can anyone refer me to any document or guide which can help me in doing so.
Also comment on how feasible it is to create a Timing Diagram using JFreeChart.
Regards,
Suvajit
I want to create a timing diagram extending JFreeChart. Can anyone refer me to any document or guide which can help me in doing so.
Also comment on how feasible it is to create a Timing Diagram using JFreeChart.
Regards,
Suvajit
Regards,
Suvajit Sengupta
Texas Instruments India
Suvajit Sengupta
Texas Instruments India
-
- Posts: 49
- Joined: Thu Jul 08, 2004 8:54 am
- Location: France
Yes, infact I am delving into code to do what I need.
But for my purpose, i.e generating a Timing Diagram is quite different from others as cannot be termed as a Chart.
In a chart all the Plots like Bar or Pie are similar for a given Chart , whereas a Timing diagram contains signals whcih are different from the other. Like a clock can be generated from afunction knowing the duty cycle and the period whereas a input or output signal we need to know (time:state) to draw the signal.
Will my reuqirment will fit into JFreeChart or not.
What do you say ?
But for my purpose, i.e generating a Timing Diagram is quite different from others as cannot be termed as a Chart.
In a chart all the Plots like Bar or Pie are similar for a given Chart , whereas a Timing diagram contains signals whcih are different from the other. Like a clock can be generated from afunction knowing the duty cycle and the period whereas a input or output signal we need to know (time:state) to draw the signal.
Will my reuqirment will fit into JFreeChart or not.
What do you say ?
Regards,
Suvajit Sengupta
Texas Instruments India
Suvajit Sengupta
Texas Instruments India
-
- Posts: 49
- Joined: Thu Jul 08, 2004 8:54 am
- Location: France
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Are the images on the right side of the following page the type of thing you mean?
http://en.wikipedia.org/wiki/Logic_analyzer
Implementing this type of thing in JFreeChart would be possible, but a fair amount of work to do it properly.
Step one is to specify the minimum interface required to represent the dataset for such diagrams. The dataset would need to supply all the information about the state at any point in time for an arbitrary number of data series.
Step 2 is to create a new plot type. This just needs a time axis, and the ability to stack an arbitrary number of data series on top of each other along a sort of "category axis". I think it would make sense to factor out a "renderer" interface, to allow the datasets to be rendered in different ways...that becomes Step 3.
http://en.wikipedia.org/wiki/Logic_analyzer
Implementing this type of thing in JFreeChart would be possible, but a fair amount of work to do it properly.
Step one is to specify the minimum interface required to represent the dataset for such diagrams. The dataset would need to supply all the information about the state at any point in time for an arbitrary number of data series.
Step 2 is to create a new plot type. This just needs a time axis, and the ability to stack an arbitrary number of data series on top of each other along a sort of "category axis". I think it would make sense to factor out a "renderer" interface, to allow the datasets to be rendered in different ways...that becomes Step 3.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Hi David,
Yes, I have started the same way and your suggestion assures that I am on right track. Actuallly I am in the process of the defining the following for Timing diagrams :
1. Timing Diagram dataset
2. Timing Diagram Plot
and
3. Timing Diagram Renderer
Hope, if I can define these and put them together a to work in, JFreechart can boast to be used for timing diagrams also. It can also prove very useful for digital circuit designers.
Yes, I have started the same way and your suggestion assures that I am on right track. Actuallly I am in the process of the defining the following for Timing diagrams :
1. Timing Diagram dataset
2. Timing Diagram Plot
and
3. Timing Diagram Renderer
Hope, if I can define these and put them together a to work in, JFreechart can boast to be used for timing diagrams also. It can also prove very useful for digital circuit designers.
Regards,
Suvajit Sengupta
Texas Instruments India
Suvajit Sengupta
Texas Instruments India
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Keep me posted on your progress. I have the feeling that this plot type (which displays state (or changes in state) through time for N series) could be made quite generic, and could even be reused for a more flexible Gantt chart than what we currently have.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Hi All,
I have been able to define the renderer and basic dataset for displaying digital signals.
But now I am stuck with defining the timeline axis and label axis against the signals. Can you give me some cue point from where I can start extending the axis to define a domain axis (x axis) such that I can define time scale for nano second, micro second, milli sec. X axis is zoomable . Wheras the range axis(y axis) values are only labels denoting the signal name, hence not zoomable.
The dataset I have extended as Category dataset.
I have been able to define the renderer and basic dataset for displaying digital signals.
But now I am stuck with defining the timeline axis and label axis against the signals. Can you give me some cue point from where I can start extending the axis to define a domain axis (x axis) such that I can define time scale for nano second, micro second, milli sec. X axis is zoomable . Wheras the range axis(y axis) values are only labels denoting the signal name, hence not zoomable.
The dataset I have extended as Category dataset.
Regards,
Suvajit Sengupta
Texas Instruments India
Suvajit Sengupta
Texas Instruments India
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
For consistency with the other plots in JFreeChart, you want the domain axis (or x-axis) to be the one that shows the signal names (you ought to be able to reuse or adapt the CategoryAxis class for this). An d the range axis (or y-axis) should be zoomable and show the timing values (a DateAxis would do this, except that it doesn't support a resolution below milliseconds).
You can use the plot orientation setting to "rotate" the chart so that the range axis is horizontal, if that's what you require.
You can use the plot orientation setting to "rotate" the chart so that the range axis is horizontal, if that's what you require.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


HI David,
Thanks for the reply.
The details of what I am using for Waveform viewer are as follows:
A. Axes :
- CategoryAxis for Y Axis
( This axis wont zoom; similar to GanttChart Domain axis)
- NumberAxis for X Axis
[ o DateAxis cannot be used since it cannot go below millisecond
o Used NumberAxis for it ]
B. Renderer :
- Defined new Rendering Class SignalRenderer from AbstractCategoryItemRenderer
( Since clock signal rendering and data signal rendering are different extended them from SignalRenderer to define ClockSignalRenderer and DataSignalRenderer)
C. Plot :
- Extended from CategoryPlot to define SignalPlot
I have used NumberAxis for X Axis and extended CategoryPlot for plot .
But CategoryPlot is not compatible for NumberAxis but for ValueAxis.
What can be a feasible solution ?
Thanks for the reply.
The details of what I am using for Waveform viewer are as follows:
A. Axes :
- CategoryAxis for Y Axis
( This axis wont zoom; similar to GanttChart Domain axis)
- NumberAxis for X Axis
[ o DateAxis cannot be used since it cannot go below millisecond
o Used NumberAxis for it ]
B. Renderer :
- Defined new Rendering Class SignalRenderer from AbstractCategoryItemRenderer
( Since clock signal rendering and data signal rendering are different extended them from SignalRenderer to define ClockSignalRenderer and DataSignalRenderer)
C. Plot :
- Extended from CategoryPlot to define SignalPlot
I have used NumberAxis for X Axis and extended CategoryPlot for plot .
But CategoryPlot is not compatible for NumberAxis but for ValueAxis.
What can be a feasible solution ?
Regards,
Suvajit Sengupta
Texas Instruments India
Suvajit Sengupta
Texas Instruments India
HI David,
Axis problem is solved. Thanks for the help. Now can you throw some light on a new iproblem I am facing.
A signal can have a list of transitions (either high(H) or low(L)) at a given time. Hence, a transition can be defined as T(t,s) where,
t = time at which the transition occured (number) and
s = state of signal after transition (enumerated value ; either H or L )
For this I have defined a new SignalDataset interface extending from CategoryDataset. I am tabulating my dataset as follows :
Col --------> 0 1 N
Row Signal\Transition | transition1 | transition2 | .............. | transition N
--------------------------------------------------------------------------------
0 SIG1 | (1,H) | (3,L) | ............. | (100,L)
1 SIG2 | (2,H) | (3,L) | ............. | (100,L)
2 SIG3 | (0,H) | (1,L) | ............. | (100,H)
:::::::::::::::
Hence , for e,g dataset.getValue(0,0) will return me (1,H) .. and object of type Transition.
As I am implementing interface CategoryDataset, the prototype for getValue is :
Number getValue(int row, int col)
wheras prototype for my getValue is :
Transition getValue(int row, int col)
and for my case there is no implementation for the getValue defined in KeyedValues2D interface.
The only solution for this is to define a dummy Number getValue(int row, int col) which will not be used. But can you suggest any other clean solution.
Regards,
Suvajit
Axis problem is solved. Thanks for the help. Now can you throw some light on a new iproblem I am facing.
A signal can have a list of transitions (either high(H) or low(L)) at a given time. Hence, a transition can be defined as T(t,s) where,
t = time at which the transition occured (number) and
s = state of signal after transition (enumerated value ; either H or L )
For this I have defined a new SignalDataset interface extending from CategoryDataset. I am tabulating my dataset as follows :
Col --------> 0 1 N
Row Signal\Transition | transition1 | transition2 | .............. | transition N
--------------------------------------------------------------------------------
0 SIG1 | (1,H) | (3,L) | ............. | (100,L)
1 SIG2 | (2,H) | (3,L) | ............. | (100,L)
2 SIG3 | (0,H) | (1,L) | ............. | (100,H)
:::::::::::::::
Hence , for e,g dataset.getValue(0,0) will return me (1,H) .. and object of type Transition.
As I am implementing interface CategoryDataset, the prototype for getValue is :
Number getValue(int row, int col)
wheras prototype for my getValue is :
Transition getValue(int row, int col)
and for my case there is no implementation for the getValue defined in KeyedValues2D interface.
The only solution for this is to define a dummy Number getValue(int row, int col) which will not be used. But can you suggest any other clean solution.
Regards,
Suvajit
Regards,
Suvajit Sengupta
Texas Instruments India
Suvajit Sengupta
Texas Instruments India