1 /*******************************************************************************
2 * Copyright (c) 2009 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * William Bourque - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.histogram
;
16 * <b><u>HistogramContent</u></b>
18 * This class hold the content that will be used to draw the Histograms.
21 public class HistogramContent
{
22 // Start and end time of the content
23 protected Long startTime
= 0L;
24 protected Long endTime
= 0L;
26 // Some information about the content
27 // Most of them are required to calculate position and/or draw
28 // Make sure they stay consistent!
29 protected Long elementsTimeInterval
= 0L;
30 protected Double heightFactor
= 0.0;
31 protected Long heighestEventCount
= 0L;
32 protected Integer maxHeight
= 0;
33 protected Integer canvasWindowSize
= 0;
34 protected Integer barsWidth
= 0;
36 // This value is used to calculate at which point we should "cut" bar that are too tall.
37 // Default value is large enought so that no bar should be cut
38 protected Double maxDifferenceToAverage
= HistogramConstant
.DEFAULT_DIFFERENCE_TO_AVERAGE
;
39 // This is a factor we might apply on the max difference to average, as example if we concatenate interval together
40 protected Double maxDifferenceFactor
= 1.0;
42 // By default we will only consider element up to this position
43 protected Integer readyUpToPosition
= 0;
45 // The average number of events in the content
46 // Note : this IS needed to draw
47 protected Integer averageNumberOfEvents
= 0;
49 // This is to draw the selected event of the TMF framework in another color
50 // Set the 0 to ignore
51 protected Long selectedEventTimeInWindow
= -1L;
53 // The table that hold the elements
54 protected HistogramElement
[] elementTable
;
58 * Default constructor for the HistogramContent.
60 * @param tableSize The size ofthe element table that will be created.
61 * @param newCanvasSize The full size of the canvas. Used for positionning; need to be consistent with canvas.
62 * @param newMaxHeight The maximum height of a bar, usually same as the height of the canvas.
64 public HistogramContent(Integer tableSize
, Integer newCanvasSize
, Integer newBarWidth
, Integer newMaxHeight
) {
65 this(tableSize
, newCanvasSize
, newBarWidth
, newMaxHeight
, HistogramConstant
.DEFAULT_DIFFERENCE_TO_AVERAGE
);
69 * Default constructor for the HistogramContent.
71 * @param tableSize The size ofthe element table that will be created.
72 * @param newCanvasSize The full size of the canvas. Used for positionning; need to be consistent with canvas.
73 * @param newMaxHeight The maximum height of a bar, usually same as the height of the canvas.
74 * @param newDiffToAverage This value at which point we "cut" bar that are too tall.
76 public HistogramContent(Integer tableSize
, Integer newCanvasSize
, Integer newBarWidth
, Integer newMaxHeight
, Double newDiffToAverage
) {
77 canvasWindowSize
= newCanvasSize
;
78 barsWidth
= newBarWidth
;
79 maxHeight
= newMaxHeight
;
80 maxDifferenceToAverage
= newDiffToAverage
;
82 // Create a new element table from the above value
83 // The table will not get initialized until resetTable() is called.
84 createNewTable(tableSize
);
88 * Create a new table to hold the content element.<p>
89 * Note that the table is not initialized (and so unusable) until resetTable() is called.
91 * @param newTableSize The size (number of element) of the table.
93 public void createNewTable(Integer newTableSize
) {
94 elementTable
= new HistogramElement
[newTableSize
];
96 for ( int x
=0; x
<elementTable
.length
; x
++) {
97 elementTable
[x
] = new HistogramElement();
98 elementTable
[x
].index
= x
;
103 * Reset all HistogramContent attributes, but keep the elements table untouched.<p>
105 public void clearContentData() {
109 elementsTimeInterval
= 0L;
111 heighestEventCount
= 0L;
113 readyUpToPosition
= 0;
117 * Reset the data in the elements table.<p>
118 * NOTE : For this to be consistent and usuable, "startTime", "endTime" and "intervalTime" need to be set already.
120 public void resetTable() {
121 for ( int x
=0; x
<elementTable
.length
; x
++) {
122 elementTable
[x
].index
= x
;
123 elementTable
[x
].firstIntervalTimestamp
= startTime
+ (x
*elementsTimeInterval
);
124 elementTable
[x
].intervalNbEvents
= 0L;
125 elementTable
[x
].intervalHeight
= 0;
130 * Reset the data in the elements table.<p>
131 * Start and EndTime will be used to calculate elementsTimeInterval.<p>
133 * @param newStartTime The new start time to use
134 * @param newEndTime The new stop time to use
136 public void resetTable(Long newStartTime
, Long newEndTime
) {
137 recalculateElementsTimeInterval(newStartTime
, newEndTime
);
138 resetTable(newStartTime
, newEndTime
, elementsTimeInterval
);
142 * Reset the data in the elements table.<p>
143 * elementsTimeInterval will be set to the one give, use this for fixed interval.<p>
145 * @param newStartTime The new start time to use
146 * @param newEndTime The new stop time to use
147 * @param newTimeInterval The new time interval to use
149 public void resetTable(Long newStartTime
, Long newEndTime
, Long newTimeInterval
) {
151 startTime
= newStartTime
;
152 endTime
= newEndTime
;
153 recalculateElementsTimeInterval(newStartTime
, newEndTime
);
155 for ( int x
=0; x
<elementTable
.length
; x
++) {
156 elementTable
[x
].index
= x
;
157 elementTable
[x
].firstIntervalTimestamp
= startTime
+ (x
*elementsTimeInterval
);
158 elementTable
[x
].intervalNbEvents
= 0L;
159 elementTable
[x
].intervalHeight
= 0;
164 * Clear (zeroed) the data in the elements table.<p>
165 * NOTE : Unlike reset, this does not recalculate the content,
166 * so it should be done either by hand or by calling reset table after.
168 public void clearTable() {
169 for ( int x
=0; x
<elementTable
.length
; x
++) {
170 elementTable
[x
].index
= x
;
171 elementTable
[x
].firstIntervalTimestamp
= 0L;
172 elementTable
[x
].intervalNbEvents
= 0L;
173 elementTable
[x
].intervalHeight
= 0;
178 * Print all HistogramContent attributes, but the elements table.
180 public void printContentInfo() {
181 System
.out
.println("startTime : " + startTime
);
182 System
.out
.println("endTime : " + endTime
);
183 System
.out
.println();
184 System
.out
.println("intervalTime : " + elementsTimeInterval
);
185 System
.out
.println("heightFactor : " + heightFactor
);
186 System
.out
.println("heighestEventCount : " + heighestEventCount
);
187 System
.out
.println();
188 System
.out
.println("readyUpToPosition : " + readyUpToPosition
);
192 * Print the data in the elements table.<p>
194 public void printTable() {
195 for ( int x
=0; x
<elementTable
.length
; x
++) {
196 System
.out
.println("X:" + x
+ " -> " + elementTable
[x
].intervalNbEvents
+ ":" + elementTable
[x
].intervalHeight
+ " (" + elementTable
[x
].firstIntervalTimestamp
+ ")");
201 * Getter for the timestamp of the selected event in the window.<p>
203 * @return The time of the event.
205 public Long
getSelectedEventTimeInWindow() {
206 return selectedEventTimeInWindow
;
210 * Setter for the timestamp of the selected event in the window.<p>
212 * This allow to pinpoint a certain event or position in the window.
213 * Set to 0 or lower to ignore.
215 * @param newPosition The new event time.
217 public void setSelectedEventTimeInWindow(Long newTime
) {
218 this.selectedEventTimeInWindow
= newTime
;
222 * Get an element in the table by its index.<p>
223 * Null is returned if the index is out of range.<p>
224 * Note that you can get an element past "readyUpToPosition", the index is NOT tested against it.
226 * @param index The index of the element (0 < index < nbElement)
228 * @return The element found or null if the index is wrong.
230 public HistogramElement
getElementByIndex(Integer index
) {
231 HistogramElement returnedElement
= null;
233 if ( (index
>= 0) && (index
< elementTable
.length
) ) {
234 returnedElement
= elementTable
[index
];
237 return returnedElement
;
241 * Return the closest element to a X position on the canvas.<p>
242 * Note : canvasWindowSize need to be set correctly here, otherwise unexpected element might be returned.<p>
244 * NOTE : This <b>ALWAYS</b> return an element;
245 * If calculation lead outside the table, the first or the last element will be returned.
247 * @param position The X position we are looking at (0 < pos < canvasWidth)
249 * @return The <i>closest</i> element found.
251 public HistogramElement
getClosestElementFromXPosition(Integer position
) {
253 int index
= (int)Math
.round((double)elementTable
.length
* ((double)position
/ (double)canvasWindowSize
) );
255 // If we are out of bound, return the closest border (first or last element)
259 else if ( index
>= elementTable
.length
) {
260 index
= (elementTable
.length
-1);
263 return elementTable
[index
];
267 * Return the closest element's timestamp to a X position on the canvas.<p>
268 * Note : canvasWindowSize need to be set correctly here, otherwise unexpected timestamp might be returned.<p>
270 * NOTE : This <b>ALWAYS</b> return a timestamp;
271 * If calculation lead outside the table, the first or the last timestamp will be returned.
273 * @param position The X position we are looking at (0 < pos < canvasWidth)
275 * @return The <i>closest</i> timestamp found.
277 public Long
getClosestTimestampFromXPosition(Integer position
) {
278 return getClosestElementFromXPosition(position
).firstIntervalTimestamp
;
282 * Return the X position (relative to the canvas) of a certain element.<p>
283 * Note : canvasWindowSize need to be set correctly here, otherwise unexpected element might be returned.<p>
285 * NOTE : This <b>ALWAYS</b> return an element;
286 * If calculation lead outside the table, the first or the last element will be returned.
288 * @param targetElement The element we are looking to find the position
290 * @return The <i>closest</i> found element.
292 public int getXPositionFromElement(HistogramElement targetElement
) {
293 return (int)Math
.round( ((double)targetElement
.index
/ (double)elementTable
.length
)*(double)canvasWindowSize
);
297 * Return the closest element to a timestamp (long) given.<p>
298 * Note : startTime and intervalTime need to be set correctly here, otherwise unexpected element might be returned.<p>
300 * NOTE : This <b>ALWAYS</b> return an element;
301 * If calculation lead outside the table, the first or the last element will be returned.
303 * @param timestamp The timestamp (in nanosecond, as long) of the element we are looking for (startTime < timestamp < endTime)
305 * @return The <i>closest</i> element found.
307 public HistogramElement
getClosestElementFromTimestamp(Long timestamp
) {
308 int index
= (int)( (timestamp
- startTime
)/elementsTimeInterval
);
310 // If we are out of bound, return the closest border (first or last element)
314 else if ( index
>= elementTable
.length
) {
315 index
= (elementTable
.length
-1);
318 return elementTable
[index
];
322 * Return the closest X position to a timestamp (long) given.<p>
323 * Note : startTime and intervalTime need to be set correctly here, otherwise unexpected position might be returned.<p>
325 * NOTE : This <b>ALWAYS</b> return a position;
326 * If calculation lead outside the table, the first or the last position will be returned.
328 * @param timestamp The timestamp (in nanosecond, as long) of the element we are looking for (startTime < timestamp < endTime)
330 * @return The <i>closest</i> position found.
332 public Integer
getClosestXPositionFromTimestamp(Long timestamp
) {
333 return getXPositionFromElement(getClosestElementFromTimestamp(timestamp
));
337 * Return the closest element to an element and a time interval to this element.<p>
338 * The time interval can be negative or positive (before or after the element).
340 * Note : IntervalTime and StartTime need to be set correctly here, otherwise unexpected result might be returned.<p>
342 * @param targetElement The element we compare the interval with.
343 * @param intervalToElement Time negative or positive time interval (in nanosecond) to this element.
345 * @return The <i>closest</i> found element, or null if given data are wrong.
347 public HistogramElement
getClosestElementByElementAndTimeInterval(HistogramElement targetElement
, Long intervalToElement
) {
349 // Get the timestamp of the target element
350 // This should always be valid as long the table is initialized
351 Long elementTime
= targetElement
.firstIntervalTimestamp
;
352 elementTime
= elementTime
+ intervalToElement
;
354 return getClosestElementFromTimestamp(elementTime
);
358 * Return the closest element to an element's timestamp (as long) and a time interval to this element.<p>
359 * The time interval can be negative or positive (before or after the element).
361 * Note : IntervalTime and StartTime need to be set correctly here, otherwise unexpected result might be returned.<p>
363 * @param timestamp The timestamp (in nanoseconds, as long) of the element we want to compare from.
364 * @param intervalToElement Time negative or positive time interval (in nanosecond) to this element.
366 * @return The <i>closest</i> found element, or null if given data are wrong.
368 public int getClosestElementByTimestampAndTimeInterval(Long timestamp
, Long intervalToElement
) {
369 HistogramElement targetElement
= getClosestElementFromTimestamp(timestamp
);
370 HistogramElement newElement
= getClosestElementByElementAndTimeInterval(targetElement
, intervalToElement
);
372 return getXPositionFromElement(newElement
);
376 * Return the closest element to an element's position and a time interval to this element.<p>
377 * The time interval can be negative or positive (before or after the element).
379 * Note : IntervalTime and StartTime need to be set correctly here, otherwise unexpected result might be returned.<p>
381 * @param targetPosition The position (relative to the canvas) of the element we want to compare from.
382 * @param intervalToElement Time negative or positive time interval (in nanosecond) to this element.
384 * @return The <i>closest</i> found element, or null if given data are wrong.
386 public int getXPositionByPositionAndTimeInterval(int targetPosition
, Long intervalToElement
) {
387 HistogramElement targetElement
= getClosestElementFromXPosition(targetPosition
);
388 HistogramElement newElement
= getClosestElementByElementAndTimeInterval(targetElement
, intervalToElement
);
390 return getXPositionFromElement(newElement
);
394 * Getter for the number of element.<p>
395 * The same as the value of tableSize given at construction.
397 * @return The number of element in the elements table.
399 public int getNbElement() {
400 return elementTable
.length
;
404 * Getter for the average number of events by interval in the content.<p>
406 * Note : Might be set externally (instead of calculated internally), so consistency with the content is not guarantee.
408 * @return Average number of events we currently use in
410 public int getAverageNumberOfEvents() {
411 return averageNumberOfEvents
;
415 * Setter for averageNumberOfEvents.<p>
417 * Note : this is used in some drawing calculation so make sure this number make sense.
418 * Note : you might want to call recalculateEventHeight() if you change this.
420 * @param newAverageNumberOfEvents The new average number of events to use.
422 public void setAverageNumberOfEvents(int newAverageNumberOfEvents
) {
423 this.averageNumberOfEvents
= newAverageNumberOfEvents
;
427 * Recalculate the average number of events by time interval.<p>
429 * Note : This run over all the element so this is quite cpu intensive, use with care.
431 public void recalculateAverageNumberOfEvents() {
434 int totalNbEvents
= 0;
436 // Go over the element up to readyUpToPosition (further position might not be ready)
437 for ( int x
=0; x
<readyUpToPosition
; x
++) {
438 // Skip the empty interval if we were asked to do so.
439 if ( HistogramConstant
.SKIP_EMPTY_INTERVALS_WHEN_CALCULATING_AVERAGE
) {
440 if ( elementTable
[x
].intervalNbEvents
> 0 ) {
448 totalNbEvents
+= elementTable
[x
].intervalNbEvents
;
450 // Calculate the average here
451 averageNumberOfEvents
= (int)((double)totalNbEvents
/ (double)nbInterval
);
455 * Getter for the start time of the content.<p>
457 * @return The start time we currently use.
459 public Long
getStartTime() {
464 * Setter for the start time of the content.<p>
465 * Note : You probably want to call "resetTable()" if you change this, otherwise data might be inconsistent.
467 * @param newStartTime the new start time
469 public void setStartTime(Long newStartTime
) {
470 this.startTime
= newStartTime
;
475 * Getter for the end time of the content.<p>
477 * @return The end time we currently use.
479 public Long
getEndTime() {
484 * Setter for the end time of the content.<p>
485 * Note : You probably want to call "resetTable()" if you change this, otherwise data might be inconsistent.
487 * @param newStartTime the new end time
489 public void setEndTime(Long newEndTime
) {
490 this.endTime
= newEndTime
;
494 * Getter for the complete time interval of the content.<p>
495 * Note : This return "endTime" minus "startTime", unlike getReadyTimeInterval() it won't check the actual time of elements.
497 * @return The complete time interval
499 public Long
getCompleteTimeInterval() {
500 return ( endTime
- startTime
);
504 * Getter for the time interval for the element between first and readyUpToPosition<p>
505 * Note : This return element[readyPosition].time - element[first].time , not the full interval like getCompleteTimeInterval()
507 * @return The time interval of the position that are ready.
509 public Long
getReadyTimeInterval() {
510 return ( elementTable
[readyUpToPosition
].firstIntervalTimestamp
- elementTable
[0].firstIntervalTimestamp
);
514 * Getter for the height factor of the bar.<p>
515 * Note : height = "nb events in interval" * heightFactor
517 * @return Height factor currently used.
519 public Double
getHeightFactor() {
524 * Recalculate the height factor of the element table.<p>
525 * Assume values of "maxHeight", "heighestEventCount" or "averageNumberOfEvents" are set correctly.
527 public void recalculateHeightFactor() {
528 // Recalculate the new HeightFactor for the element;
529 // the highest bar will get "maxHeight" and other bar a fraction of it.
530 double diffToConsider
= (maxDifferenceToAverage
* maxDifferenceFactor
* (double)barsWidth
);
531 if ( heighestEventCount
> (int)(diffToConsider
* (double)averageNumberOfEvents
) ) {
532 heightFactor
= (double)maxHeight
/( diffToConsider
* (double)averageNumberOfEvents
);
535 heightFactor
= (double)maxHeight
/(double)heighestEventCount
;
540 * Recalculate the height of each bar in the elements table.<p>
541 * This assume "heightFactor" is already set correctly.<p>
543 * NOTE : if "maxHeight", "heighestEventCount" or "averageNumberOfEvents" changes,
544 * recalculateHeightFactor() should be recalled.
546 public void recalculateEventHeight() {
547 // Recalculate the height of the bars up to "readyUpToPosition"
548 for ( int x
=0; x
<readyUpToPosition
; x
++) {
549 elementTable
[x
].intervalHeight
= (int)(elementTable
[x
].intervalNbEvents
* heightFactor
);
554 * Recalculate the height of each bar in a certain interval of the elements table.<p>
555 * Unlike recalculateEventHeight(), this only recalculate for the given range, not the whole table.
558 public void recalculateEventHeightInInterval(Integer startPosition
, Integer stopPosition
) {
559 // Basic error checking on start : should be bigger than 0
560 if ( startPosition
< 0 ) {
564 // Basic error checking on start : should be smaller than length - 1
565 if ( stopPosition
>= elementTable
.length
) {
566 stopPosition
= (elementTable
.length
-1);
569 // Recalculate the height of the bars from startPosition to stopPosition
570 for ( int x
=startPosition
; x
<stopPosition
; x
++) {
571 elementTable
[x
].intervalHeight
= (int)(elementTable
[x
].intervalNbEvents
* heightFactor
);
576 * Getter for the full size of the canvas.<p>
577 * This is used for the positionnal calculation so should be consistent with the real canvas size.
579 * @return Size of the canvas we currently use.
581 public Integer
getCanvasWindowSize() {
582 return canvasWindowSize
;
586 * Set a new full size of the canvas.<p>
587 * This is used for the positionnal calculation so should be consistent with the real canvas size.
589 * @param newSize New canvas size;
591 public void setCanvasWindowSize(Integer newSize
) {
592 canvasWindowSize
= newSize
;
596 * Getter for the heighest event count recorded so far for an interval.<p>
598 * Note : Might be set externally (instead of calculated internally), so consistency with the content is not guarantee.
600 * @return Current heighestEventCount
602 public Long
getHeighestEventCount() {
603 return heighestEventCount
;
607 * Setter for setHeighestEventCount.<p>
609 * Note : this is used in some drawing calculation so make sure this number make sense.
610 * Note : you might want to call recalculateEventHeight() if you change this.
612 * @param newHeighestEventCount Heighest event count for a single interval.
614 public void setHeighestEventCount(Long newHeighestEventCount
) {
615 this.heighestEventCount
= newHeighestEventCount
;
619 * Recalculate the heightest event count for a single time interval.<p>
621 * Note : This run over all the element so this is quite cpu intensive, use with care.
623 public void recalculateHeighestEventCount() {
624 // Go over the element up to readyUpToPosition (further position might not be ready)
625 for ( int x
=0; x
<readyUpToPosition
; x
++) {
626 if ( elementTable
[x
].intervalNbEvents
> heighestEventCount
) {
627 this.heighestEventCount
= elementTable
[x
].intervalNbEvents
;
633 * Getter for the max height of a bar in the content.<p>
635 * @return maximum height for a bar we currently use.
637 public Integer
getMaxHeight() {
642 * Setter for maxHeight.<p>
644 * Note : this is used in some drawing calculation so make sure this number make sense.
645 * Note : you might want to call recalculateEventHeight() if you change this.
647 * @param maxHeight The new maximum height for a bar to use.
649 public void setMaxHeight(Integer maxHeight
) {
650 this.maxHeight
= maxHeight
;
654 * Getter for the max difference to the average height a bar can have.<p>
655 * This determine at which point a bar too tall is "cut". Set a very large value (like 1000.0) to ignore.
657 * @return maximum difference to the average we currently use.
659 public Double
getMaxDifferenceToAverage() {
660 return maxDifferenceToAverage
;
664 * Setter for the max difference to the average height a bar can have.<p>
665 * This determine at which point a bar too tall is "cut". Set a very large value (like 1000.0) to ignore.
667 * Note : this is used in some drawing calculation so make sure this number make sense.
668 * Note : you might want to call recalculateEventHeight() if you change this.
670 * @param newDiffToAverage The new maximum difference to the average to use.
672 public void setMaxDifferenceToAverage(Double newDiffToAverage
) {
673 maxDifferenceToAverage
= newDiffToAverage
;
678 * Getter for a factor applied to the max difference to the average height a bar can have.<p>
679 * This is muliplied to maxDifferenceToAverage. Set to value 1.0 to ignore.
681 * Note : this is useful if you concatenate some intervals to gether but want the average to be consistent
683 * @return maximum difference to the average we currently use.
685 public Double
getMaxDifferenceToAverageFactor() {
686 return maxDifferenceFactor
;
690 * Setter for a factor applied to the max difference to the average height a bar can have.<p>
692 * Note : this is used in some drawing calculation so make sure this number make sense.
693 * Note : you might want to call recalculateEventHeight() if you change this.
694 * Note : setting to 0 will cause bar to have a zero size... use 1.0 to desactivate
696 * @param newFactor The new factor to use.
698 public void setMaxDifferenceToAverageFactor(Double newFactor
) {
699 maxDifferenceFactor
= newFactor
;
704 * Getter for the interval time of each interval.<p>
705 * This is usually "(EndTime - StartTime) / NbElement"
707 * @return Currently used interval time.
709 public Long
getElementsTimeInterval() {
710 return elementsTimeInterval
;
715 * Setter for the interval time of each interval.<p>
717 * Note : this is used in some drawing calculation so make sure this number make sense.
718 * Note : you migth want to call resetTable() to to fill the element's table again if you change this.
720 * @return New interval time.
722 public void setElementsTimeInterval(Long newInterval
) {
723 this.elementsTimeInterval
= newInterval
;
728 * Calculate the correct time interval of each element from the given time.<p>
730 * @return The complete time interval
732 public void recalculateElementsTimeInterval(Long startTime
, Long endTime
) {
733 this.elementsTimeInterval
= ((endTime
- startTime
)/getNbElement());
738 * Getter for readyUpToPosition.<p>
739 * This should tell to which point the content is filled, calculated and ready to use.
741 * @return Last position processed so far.
743 public Integer
getReadyUpToPosition() {
744 return readyUpToPosition
;
748 * Setter for readyUpToPosition.<p>
749 * Set a new point (position) up to where the content is filled, calculated and ready to use.
751 * @param newReadyUpToPosition The new position to use.
753 public void setReadyUpToPosition(int newReadyUpToPosition
) {
754 this.readyUpToPosition
= newReadyUpToPosition
;
758 * Getter for the bar width.<p>
759 * This is needed by the paint listener usually.
761 * @return current bars width;
763 public Integer
getBarsWidth() {
768 * Setter for the bar width.<p>
769 * Setting this to 0 will hide all the bar in the histogram.
771 * @param newBarsWidth new bars width;
773 public void setBarsWidth(Integer newBarsWidth
) {
774 this.barsWidth
= newBarsWidth
;