View | Details | Raw Unified | Return to bug 53070
Collapse All | Expand All

(-)src/core/org/apache/jmeter/resources/messages_fr.properties (-4 / +6 lines)
Lines 25-41 Link Here
25
add_value=Ajouter valeur
25
add_value=Ajouter valeur
26
addtest=Ajout
26
addtest=Ajout
27
aggregate_graph=Graphique des statistiques
27
aggregate_graph=Graphique des statistiques
28
aggregate_graph_choose_bar_color=Couleur barre
29
aggregate_graph_choose_color=Choisir couleur
28
aggregate_graph_choose_color=Choisir couleur
30
aggregate_graph_choose_foreground_color=Couleur valeur
29
aggregate_graph_choose_foreground_color=Couleur valeur
31
aggregate_graph_color_bar=Couleur \:
30
aggregate_graph_color_bar=Couleur \:
32
aggregate_graph_column=Colonne
31
aggregate_graph_column=Colonne
33
aggregate_graph_column_selection=S\u00E9lection de colonnes par libell\u00E9 \:
32
aggregate_graph_column_selection=S\u00E9lection de colonnes par libell\u00E9 \:
34
aggregate_graph_column_settings=Param\u00E8tres colonne
33
aggregate_graph_column_settings=Param\u00E8tres colonne
35
aggregate_graph_current_colors=Couleurs courantes
34
aggregate_graph_columns_to_display=Colonnes \u00E0 afficher \:
36
aggregate_graph_dimension=Taille graphique
35
aggregate_graph_dimension=Taille graphique
37
aggregate_graph_display=G\u00E9n\u00E9rer le graphique
36
aggregate_graph_display=G\u00E9n\u00E9rer le graphique
38
aggregate_graph_draw_outlines=Bordures barre ?
37
aggregate_graph_draw_outlines=Bordure de barre ?
39
aggregate_graph_dynamic_size=Taille de graphique dynamique
38
aggregate_graph_dynamic_size=Taille de graphique dynamique
40
aggregate_graph_font=Police \:
39
aggregate_graph_font=Police \:
41
aggregate_graph_height=Hauteur \:
40
aggregate_graph_height=Hauteur \:
Lines 47-52 Link Here
47
aggregate_graph_legend_placement=Position \:
46
aggregate_graph_legend_placement=Position \:
48
aggregate_graph_max_length_xaxis_label=Longueur maximum du libell\u00E9 de l'axe des abscisses \:
47
aggregate_graph_max_length_xaxis_label=Longueur maximum du libell\u00E9 de l'axe des abscisses \:
49
aggregate_graph_ms=Millisecondes
48
aggregate_graph_ms=Millisecondes
49
aggregate_graph_no_values_to_graph=Pas de valeurs pour le graphique
50
aggregate_graph_number_grouping=S\u00E9parateur de milliers ?
50
aggregate_graph_number_grouping=S\u00E9parateur de milliers ?
51
aggregate_graph_reload_data=Recharger les donn\u00E9es
51
aggregate_graph_reload_data=Recharger les donn\u00E9es
52
aggregate_graph_response_time=Temps de r\u00E9ponse
52
aggregate_graph_response_time=Temps de r\u00E9ponse
Lines 62-67 Link Here
62
aggregate_graph_title_group=Titre
62
aggregate_graph_title_group=Titre
63
aggregate_graph_use_group_name=Ajouter le nom du groupe aux libell\u00E9s
63
aggregate_graph_use_group_name=Ajouter le nom du groupe aux libell\u00E9s
64
aggregate_graph_user_title=Titre du graphique \:
64
aggregate_graph_user_title=Titre du graphique \:
65
aggregate_graph_value_font=Police de la valeur \:
66
aggregate_graph_value_labels_vertical=Libell\u00E9 de valeurs vertical ?
65
aggregate_graph_width=Largeur \:
67
aggregate_graph_width=Largeur \:
66
aggregate_graph_xaxis_group=Abscisses
68
aggregate_graph_xaxis_group=Abscisses
67
aggregate_graph_yaxis_group=Ordonn\u00E9es
69
aggregate_graph_yaxis_group=Ordonn\u00E9es
Lines 159-165 Link Here
159
comparison_regex_string=Expression r\u00E9guli\u00E8re
161
comparison_regex_string=Expression r\u00E9guli\u00E8re
160
comparison_regex_substitution=Substitution
162
comparison_regex_substitution=Substitution
161
comparison_response_time=Temps de r\u00E9ponse \: 
163
comparison_response_time=Temps de r\u00E9ponse \: 
162
comparison_unit= ms
164
comparison_unit=ms
163
comparison_visualizer_title=R\u00E9cepteur d'assertions de comparaison
165
comparison_visualizer_title=R\u00E9cepteur d'assertions de comparaison
164
config_element=El\u00E9ment de configuration
166
config_element=El\u00E9ment de configuration
165
config_save_settings=Configurer
167
config_save_settings=Configurer
(-)src/core/org/apache/jmeter/resources/messages.properties (-6 / +8 lines)
Lines 31-61 Link Here
31
add_value=Add Value
31
add_value=Add Value
32
addtest=Add test
32
addtest=Add test
33
aggregate_graph=Statistical Graphs
33
aggregate_graph=Statistical Graphs
34
aggregate_graph_choose_bar_color=Bar color
35
aggregate_graph_choose_color=Choose color
34
aggregate_graph_choose_color=Choose color
36
aggregate_graph_choose_foreground_color=Foreground color
35
aggregate_graph_choose_foreground_color=Foreground color
37
aggregate_graph_color_bar=Color\:
36
aggregate_graph_color_bar=Color\:
38
aggregate_graph_column=Column\:
37
aggregate_graph_column=Column\:
39
aggregate_graph_column_selection=Column label selection\:
38
aggregate_graph_column_selection=Column label selection\:
40
aggregate_graph_column_settings=Column settings
39
aggregate_graph_column_settings=Column settings
41
aggregate_graph_current_colors=Current colors
40
aggregate_graph_columns_to_display=Columns to display\:
42
aggregate_graph_dimension=Graph size
41
aggregate_graph_dimension=Graph size
42
aggregate_graph_display=Display Graph
43
aggregate_graph_draw_outlines=Draw outlines bar?
43
aggregate_graph_draw_outlines=Draw outlines bar?
44
aggregate_graph_dynamic_size=Dynamic graph size
44
aggregate_graph_dynamic_size=Dynamic graph size
45
aggregate_graph_display=Display Graph
46
aggregate_graph_font=Font\:
45
aggregate_graph_font=Font\:
47
aggregate_graph_height=Height\:
46
aggregate_graph_height=Height\:
48
aggregate_graph_legend=Legend
47
aggregate_graph_legend=Legend
49
aggregate_graph_legend_placement=Placement\:
50
aggregate_graph_legend.placement.bottom=Bottom
48
aggregate_graph_legend.placement.bottom=Bottom
51
aggregate_graph_legend.placement.right=Right
52
aggregate_graph_legend.placement.left=Left
49
aggregate_graph_legend.placement.left=Left
50
aggregate_graph_legend.placement.right=Right
53
aggregate_graph_legend.placement.top=Top
51
aggregate_graph_legend.placement.top=Top
52
aggregate_graph_legend_placement=Placement\:
54
aggregate_graph_max_length_xaxis_label=Max length of x-axis label\:
53
aggregate_graph_max_length_xaxis_label=Max length of x-axis label\:
55
aggregate_graph_ms=Milliseconds
54
aggregate_graph_ms=Milliseconds
55
aggregate_graph_no_values_to_graph=No values to graph
56
aggregate_graph_number_grouping=Show number grouping?
56
aggregate_graph_number_grouping=Show number grouping?
57
aggregate_graph_response_time=Response Time
58
aggregate_graph_reload_data=Reload data
57
aggregate_graph_reload_data=Reload data
58
aggregate_graph_response_time=Response Time
59
aggregate_graph_save=Save Graph
59
aggregate_graph_save=Save Graph
60
aggregate_graph_save_table=Save Table Data
60
aggregate_graph_save_table=Save Table Data
61
aggregate_graph_save_table_header=Save Table Header
61
aggregate_graph_save_table_header=Save Table Header
Lines 68-73 Link Here
68
aggregate_graph_title_group=Title
68
aggregate_graph_title_group=Title
69
aggregate_graph_use_group_name=Include group name in label?
69
aggregate_graph_use_group_name=Include group name in label?
70
aggregate_graph_user_title=Graph title\:
70
aggregate_graph_user_title=Graph title\:
71
aggregate_graph_value_font=Value font\:
72
aggregate_graph_value_labels_vertical=Value labels vertical?
71
aggregate_graph_width=Width\:
73
aggregate_graph_width=Width\:
72
aggregate_graph_xaxis_group=X Axis
74
aggregate_graph_xaxis_group=X Axis
73
aggregate_graph_yaxis_group=Y Axis
75
aggregate_graph_yaxis_group=Y Axis
(-)src/components/org/apache/jmeter/visualizers/AxisGraph.java (-20 / +61 lines)
Lines 38-45 Link Here
38
import org.jCharts.chartData.ChartDataException;
38
import org.jCharts.chartData.ChartDataException;
39
import org.jCharts.chartData.DataSeries;
39
import org.jCharts.chartData.DataSeries;
40
import org.jCharts.properties.AxisProperties;
40
import org.jCharts.properties.AxisProperties;
41
import org.jCharts.properties.BarChartProperties;
42
import org.jCharts.properties.ChartProperties;
41
import org.jCharts.properties.ChartProperties;
42
import org.jCharts.properties.ClusteredBarChartProperties;
43
import org.jCharts.properties.DataAxisProperties;
43
import org.jCharts.properties.DataAxisProperties;
44
import org.jCharts.properties.LabelAxisProperties;
44
import org.jCharts.properties.LabelAxisProperties;
45
import org.jCharts.properties.LegendProperties;
45
import org.jCharts.properties.LegendProperties;
Lines 67-85 Link Here
67
    protected String[] xAxisLabels;
67
    protected String[] xAxisLabels;
68
    protected int width, height;
68
    protected int width, height;
69
    
69
    
70
    protected String[] legendLabels = { JMeterUtils.getResString("aggregate_graph_legend") };
71
    
70
    protected int maxYAxisScale;
72
    protected int maxYAxisScale;
71
73
72
    protected Font titleFont;
74
    protected Font titleFont;
73
75
74
    protected Font legendFont;
76
    protected Font legendFont;
75
77
76
    protected Color color;
78
    protected Font valueFont = new Font("SansSerif", Font.PLAIN, 8);
79
80
    protected Color[] color = { Color.YELLOW };
77
81
78
    protected Color foreColor;
82
    protected Color foreColor = Color.BLACK;
79
83
80
    protected boolean outlinesBarFlag = false;
84
    protected boolean outlinesBarFlag = false;
81
85
82
    protected boolean showGrouping = true;
86
    protected boolean showGrouping = true;
87
    
88
    protected boolean valueOrientation = true;
83
89
84
    protected int legendPlacement = LegendProperties.BOTTOM;
90
    protected int legendPlacement = LegendProperties.BOTTOM;
85
91
Lines 133-138 Link Here
133
        this.yAxisLabel = label;
139
        this.yAxisLabel = label;
134
    }
140
    }
135
141
142
    public void setLegendLabels(String[] labels) {
143
        this.legendLabels = labels;
144
    }
145
136
    public void setWidth(int w) {
146
    public void setWidth(int w) {
137
        this.width = w;
147
        this.width = w;
138
    }
148
    }
Lines 158-171 Link Here
158
    /**
168
    /**
159
     * @return the color
169
     * @return the color
160
     */
170
     */
161
    public Color getColor() {
171
    public Color[] getColor() {
162
        return color;
172
        return color;
163
    }
173
    }
164
174
165
    /**
175
    /**
166
     * @param color the color to set
176
     * @param color the color to set
167
     */
177
     */
168
    public void setColor(Color color) {
178
    public void setColor(Color[] color) {
169
        this.color = color;
179
        this.color = color;
170
    }
180
    }
171
181
Lines 212-217 Link Here
212
    }
222
    }
213
223
214
    /**
224
    /**
225
     * @return the valueFont
226
     */
227
    public Font getValueFont() {
228
        return valueFont;
229
    }
230
231
    /**
232
     * @param valueFont the valueFont to set
233
     */
234
    public void setValueFont(Font valueFont) {
235
        this.valueFont = valueFont;
236
    }
237
238
    /**
215
     * @return the legendPlacement
239
     * @return the legendPlacement
216
     */
240
     */
217
    public int getLegendPlacement() {
241
    public int getLegendPlacement() {
Lines 240-245 Link Here
240
    }
264
    }
241
265
242
    /**
266
    /**
267
     * @return the valueOrientation
268
     */
269
    public boolean isValueOrientation() {
270
        return valueOrientation;
271
    }
272
273
    /**
274
     * @param valueOrientation the valueOrientation to set
275
     */
276
    public void setValueOrientation(boolean valueOrientation) {
277
        this.valueOrientation = valueOrientation;
278
    }
279
280
    /**
243
     * @return the showGrouping
281
     * @return the showGrouping
244
     */
282
     */
245
    public boolean isShowGrouping() {
283
    public boolean isShowGrouping() {
Lines 258-265 Link Here
258
        if (data != null && this.title != null && this.xAxisLabels != null &&
296
        if (data != null && this.title != null && this.xAxisLabels != null &&
259
                this.xAxisTitle != null && this.yAxisLabel != null &&
297
                this.xAxisTitle != null && this.yAxisLabel != null &&
260
                this.yAxisTitle != null) {
298
                this.yAxisTitle != null) {
261
            drawSample(this.title,this.maxLength,this.xAxisLabels,this.xAxisTitle,
299
            drawSample(this.title, this.maxLength, this.xAxisLabels,
262
                this.yAxisTitle,this.data,this.width,this.height,this.color,this.legendFont,graphics);
300
                    this.xAxisTitle, this.yAxisTitle, this.legendLabels,
301
                    this.data, this.width, this.height, this.color,
302
                    this.legendFont, graphics);
263
        }
303
        }
264
    }
304
    }
265
305
Lines 285-291 Link Here
285
    }
325
    }
286
326
287
    private void drawSample(String _title, int _maxLength, String[] _xAxisLabels, String _xAxisTitle,
327
    private void drawSample(String _title, int _maxLength, String[] _xAxisLabels, String _xAxisTitle,
288
            String _yAxisTitle, double[][] _data, int _width, int _height, Color color, Font font, Graphics g) {
328
            String _yAxisTitle, String[] _legendLabels, double[][] _data, int _width, int _height, Color[] _color, Font font, Graphics g) {
289
        double max = maxYAxisScale > 0 ? maxYAxisScale : findMax(_data); // define max scale y axis
329
        double max = maxYAxisScale > 0 ? maxYAxisScale : findMax(_data); // define max scale y axis
290
        try {
330
        try {
291
            /** These controls are already done in StatGraphVisualizer
331
            /** These controls are already done in StatGraphVisualizer
Lines 309-333 Link Here
309
                _xAxisLabels[i]=squeeze(label, _maxLength);
349
                _xAxisLabels[i]=squeeze(label, _maxLength);
310
            }
350
            }
311
            this.setPreferredSize(new Dimension(_width,_height));
351
            this.setPreferredSize(new Dimension(_width,_height));
312
            DataSeries dataSeries = new DataSeries( _xAxisLabels, _xAxisTitle, _yAxisTitle, _title );
352
            DataSeries dataSeries = new DataSeries( _xAxisLabels, null, _yAxisTitle, _title ); // replace _xAxisTitle to null (don't display x axis title)
313
353
314
            String[] legendLabels= { yAxisLabel };
354
            ClusteredBarChartProperties clusteredBarChartProperties= new ClusteredBarChartProperties();
315
355
            clusteredBarChartProperties.setShowOutlinesFlag(outlinesBarFlag);
316
            BarChartProperties barChartProperties= new BarChartProperties();
317
            barChartProperties.setShowOutlinesFlag(outlinesBarFlag);
318
            ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer(false, false, showGrouping, 0);
356
            ValueLabelRenderer valueLabelRenderer = new ValueLabelRenderer(false, false, showGrouping, 0);
319
            valueLabelRenderer.setValueLabelPosition(ValueLabelPosition.AT_TOP);
357
            valueLabelRenderer.setValueLabelPosition(ValueLabelPosition.AT_TOP);
320
            valueLabelRenderer.useVerticalLabels(true);
358
321
            if (legendFont != null) {
359
            valueLabelRenderer.setValueChartFont(new ChartFont(valueFont, foreColor));
322
                valueLabelRenderer.setValueChartFont(new ChartFont(legendFont, new Color(foreColor.getRGB())));
360
            valueLabelRenderer.useVerticalLabels(valueOrientation);
361
362
            clusteredBarChartProperties.addPostRenderEventListener(valueLabelRenderer);
363
364
            Paint[] paints = new Paint[_color.length];
365
            for (int i = 0; i < _color.length; i++) {
366
                paints[i] =  _color[i];
323
            }
367
            }
324
            
368
            
325
            barChartProperties.addPostRenderEventListener(valueLabelRenderer);
326
327
            Paint[] paints = new Paint[] { color };
328
            AxisChartDataSet axisChartDataSet =
369
            AxisChartDataSet axisChartDataSet =
329
                new AxisChartDataSet(
370
                new AxisChartDataSet(
330
                        _data, legendLabels, paints, ChartType.BAR, barChartProperties );
371
                        _data, _legendLabels, paints, ChartType.BAR_CLUSTERED, clusteredBarChartProperties );
331
            dataSeries.addIAxisPlotDataSet( axisChartDataSet );
372
            dataSeries.addIAxisPlotDataSet( axisChartDataSet );
332
373
333
            ChartProperties chartProperties= new ChartProperties();
374
            ChartProperties chartProperties= new ChartProperties();
(-)src/components/org/apache/jmeter/visualizers/StatGraphVisualizer.java (-52 / +167 lines)
Lines 46-51 Link Here
46
import javax.swing.JComponent;
46
import javax.swing.JComponent;
47
import javax.swing.JFileChooser;
47
import javax.swing.JFileChooser;
48
import javax.swing.JLabel;
48
import javax.swing.JLabel;
49
import javax.swing.JOptionPane;
49
import javax.swing.JPanel;
50
import javax.swing.JPanel;
50
import javax.swing.JScrollPane;
51
import javax.swing.JScrollPane;
51
import javax.swing.JSplitPane;
52
import javax.swing.JSplitPane;
Lines 110-115 Link Here
110
        JMeterUtils.getResString("aggregate_report_total_label");       //$NON-NLS-1$
111
        JMeterUtils.getResString("aggregate_report_total_label");       //$NON-NLS-1$
111
    
112
    
112
    private final Border MARGIN = new EmptyBorder(0, 5, 0, 5);
113
    private final Border MARGIN = new EmptyBorder(0, 5, 0, 5);
114
    
115
    private Font FONT_SMALL = new Font("SansSerif", Font.PLAIN, 10);
113
116
114
    private JTable myJTable;
117
    private JTable myJTable;
115
118
Lines 144-152 Link Here
144
    private JButton saveTable =
147
    private JButton saveTable =
145
        new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));            //$NON-NLS-1$
148
        new JButton(JMeterUtils.getResString("aggregate_graph_save_table"));            //$NON-NLS-1$
146
149
147
    private JButton chooseBarColor =
148
        new JButton(JMeterUtils.getResString("aggregate_graph_choose_bar_color"));            //$NON-NLS-1$
149
150
    private JButton chooseForeColor =
150
    private JButton chooseForeColor =
151
        new JButton(JMeterUtils.getResString("aggregate_graph_choose_foreground_color"));            //$NON-NLS-1$
151
        new JButton(JMeterUtils.getResString("aggregate_graph_choose_foreground_color"));            //$NON-NLS-1$
152
152
Lines 185-194 Link Here
185
185
186
    private int defaultHeight = 300;
186
    private int defaultHeight = 300;
187
187
188
    private JLabel currentColor = new JLabel(JMeterUtils.getResString("aggregate_graph_current_colors"));   //$NON-NLS-1$
189
190
    private JComboBox columnsList = new JComboBox(GRAPH_COLUMNS);
188
    private JComboBox columnsList = new JComboBox(GRAPH_COLUMNS);
191
189
190
    private List<BarGraph> eltList = new ArrayList<BarGraph>();
191
192
    private JCheckBox columnSelection = new JCheckBox(JMeterUtils.getResString("aggregate_graph_column_selection"), false); //$NON-NLS-1$
192
    private JCheckBox columnSelection = new JCheckBox(JMeterUtils.getResString("aggregate_graph_column_selection"), false); //$NON-NLS-1$
193
193
194
    private JTextField columnMatchLabel = new JTextField();
194
    private JTextField columnMatchLabel = new JTextField();
Lines 205-210 Link Here
205
205
206
    private JComboBox titleFontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
206
    private JComboBox titleFontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
207
207
208
    private JComboBox valueFontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
209
210
    private JComboBox valueFontSizeList = new JComboBox(StatGraphProperties.fontSize);
211
212
    private JComboBox valueFontStyleList = new JComboBox(StatGraphProperties.getFontStyleMap().keySet().toArray());
213
208
    private JComboBox fontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
214
    private JComboBox fontNameList = new JComboBox(StatGraphProperties.getFontNameMap().keySet().toArray());
209
215
210
    private JComboBox fontSizeList = new JComboBox(StatGraphProperties.fontSize);
216
    private JComboBox fontSizeList = new JComboBox(StatGraphProperties.fontSize);
Lines 216-225 Link Here
216
    private JCheckBox drawOutlinesBar = new JCheckBox(JMeterUtils.getResString("aggregate_graph_draw_outlines"), true); // Default checked // $NON-NLS-1$
222
    private JCheckBox drawOutlinesBar = new JCheckBox(JMeterUtils.getResString("aggregate_graph_draw_outlines"), true); // Default checked // $NON-NLS-1$
217
223
218
    private JCheckBox numberShowGrouping = new JCheckBox(JMeterUtils.getResString("aggregate_graph_number_grouping"), true); // Default checked // $NON-NLS-1$
224
    private JCheckBox numberShowGrouping = new JCheckBox(JMeterUtils.getResString("aggregate_graph_number_grouping"), true); // Default checked // $NON-NLS-1$
225
    
226
    private JCheckBox valueLabelsVertical = new JCheckBox(JMeterUtils.getResString("aggregate_graph_value_labels_vertical"), true); // Default checked // $NON-NLS-1$
219
227
220
    private Color colorBarGraph = Color.YELLOW;
228
    private Color colorBarGraph = Color.YELLOW;
221
229
222
    private Color colorForeGraph = Color.BLACK;
230
    private Color colorForeGraph = Color.BLACK;
231
    
232
    private int nbColToGraph = 1;
223
233
224
    public StatGraphVisualizer() {
234
    public StatGraphVisualizer() {
225
        super();
235
        super();
Lines 240-245 Link Here
240
                new Functor[] { null, null, null, null, null, null, null, null,    null, null },
250
                new Functor[] { null, null, null, null, null, null, null, null,    null, null },
241
                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, Long.class,
251
                new Class[] { String.class, Long.class, Long.class, Long.class, Long.class, Long.class,
242
                Long.class, String.class, String.class, String.class });
252
                Long.class, String.class, String.class, String.class });
253
        eltList.add(new BarGraph("average", true, new Color(202, 0, 0)));
254
        eltList.add(new BarGraph("aggregate_report_median", false, new Color(49, 49, 181)));
255
        eltList.add(new BarGraph("aggregate_report_90%_line", false, new Color(42, 121, 42)));
256
        eltList.add(new BarGraph("aggregate_report_min", false, Color.LIGHT_GRAY));
257
        eltList.add(new BarGraph("aggregate_report_max", false, Color.DARK_GRAY));
243
        clearData();
258
        clearData();
244
        init();
259
        init();
245
    }
260
    }
Lines 357-374 Link Here
357
    }
372
    }
358
373
359
    public void makeGraph() {
374
    public void makeGraph() {
375
        nbColToGraph = getNbColumns();
360
        Dimension size = graphPanel.getSize();
376
        Dimension size = graphPanel.getSize();
361
        String wstr = graphWidth.getText();
362
        String hstr = graphHeight.getText();
363
        String lstr = maxLengthXAxisLabel.getText();
377
        String lstr = maxLengthXAxisLabel.getText();
378
        // canvas size
364
        int width = (int) size.getWidth();
379
        int width = (int) size.getWidth();
365
        if (wstr.length() != 0) {
366
            width = Integer.parseInt(wstr);
367
        }
368
        int height = (int) size.getHeight();
380
        int height = (int) size.getHeight();
369
        if (hstr.length() != 0) {
381
        if (!dynamicGraphSize.isSelected()) {
370
            height = Integer.parseInt(hstr);
382
            String wstr = graphWidth.getText();
383
            String hstr = graphHeight.getText();
384
            if (wstr.length() != 0) {
385
                width = Integer.parseInt(wstr);
386
            }
387
            if (hstr.length() != 0) {
388
                height = Integer.parseInt(hstr);
389
            }
371
        }
390
        }
391
372
        if (lstr.length() == 0) {
392
        if (lstr.length() == 0) {
373
            lstr = "20";//$NON-NLS-1$
393
            lstr = "20";//$NON-NLS-1$
374
        }
394
        }
Lines 384-393 Link Here
384
        graphPanel.setXAxisTitle((String) columnsList.getSelectedItem());
404
        graphPanel.setXAxisTitle((String) columnsList.getSelectedItem());
385
        graphPanel.setYAxisLabels(this.yAxisLabel);
405
        graphPanel.setYAxisLabels(this.yAxisLabel);
386
        graphPanel.setYAxisTitle(this.yAxisTitle);
406
        graphPanel.setYAxisTitle(this.yAxisTitle);
387
        graphPanel.setColor(colorBarGraph);
407
        graphPanel.setLegendLabels(getLegendLabels());
408
        graphPanel.setColor(getBackColors());
388
        graphPanel.setForeColor(colorForeGraph);
409
        graphPanel.setForeColor(colorForeGraph);
389
        graphPanel.setOutlinesBarFlag(drawOutlinesBar.isSelected());
410
        graphPanel.setOutlinesBarFlag(drawOutlinesBar.isSelected());
390
        graphPanel.setShowGrouping(numberShowGrouping.isSelected());
411
        graphPanel.setShowGrouping(numberShowGrouping.isSelected());
412
        graphPanel.setValueOrientation(valueLabelsVertical.isSelected());
391
        graphPanel.setLegendPlacement(StatGraphProperties.getPlacementNameMap()
413
        graphPanel.setLegendPlacement(StatGraphProperties.getPlacementNameMap()
392
                .get(legendPlacementList.getSelectedItem()).intValue());
414
                .get(legendPlacementList.getSelectedItem()).intValue());
393
415
Lines 397-402 Link Here
397
        graphPanel.setLegendFont(new Font(StatGraphProperties.getFontNameMap().get(fontNameList.getSelectedItem()),
419
        graphPanel.setLegendFont(new Font(StatGraphProperties.getFontNameMap().get(fontNameList.getSelectedItem()),
398
                StatGraphProperties.getFontStyleMap().get(fontStyleList.getSelectedItem()).intValue(),
420
                StatGraphProperties.getFontStyleMap().get(fontStyleList.getSelectedItem()).intValue(),
399
                Integer.parseInt((String) fontSizeList.getSelectedItem())));
421
                Integer.parseInt((String) fontSizeList.getSelectedItem())));
422
        graphPanel.setValueFont(new Font(StatGraphProperties.getFontNameMap().get(valueFontNameList.getSelectedItem()),
423
                StatGraphProperties.getFontStyleMap().get(valueFontStyleList.getSelectedItem()).intValue(),
424
                Integer.parseInt((String) valueFontSizeList.getSelectedItem())));
400
425
401
        graphPanel.setHeight(height);
426
        graphPanel.setHeight(height);
402
        graphPanel.setWidth(width);
427
        graphPanel.setWidth(width);
Lines 406-419 Link Here
406
    public double[][] getData() {
431
    public double[][] getData() {
407
        if (model.getRowCount() > 1) {
432
        if (model.getRowCount() > 1) {
408
            int count = model.getRowCount() -1;
433
            int count = model.getRowCount() -1;
409
            int col = model.findColumn((String) columnsList.getSelectedItem());
434
            
410
            double[][] data = new double[1][count];
435
            int size = nbColToGraph;
411
            for (int idx=0; idx < count; idx++) {
436
            double[][] data = new double[size][count];
412
                data[0][idx] = ((Number)model.getValueAt(idx,col)).doubleValue();
437
            int s = 0;
438
            int cpt = 0;
439
            for (BarGraph bar : eltList) {
440
                if (bar.getChkBox().isSelected()) {
441
                    int col = model.findColumn((String) columnsList.getItemAt(cpt));
442
                    for (int idx=0; idx < count; idx++) {
443
                        data[s][idx] = ((Number)model.getValueAt(idx,col)).doubleValue();
444
                    }
445
                    s++;
446
                }
447
                cpt++;
413
            }
448
            }
414
            return data;
449
            return data;
415
        }
450
        }
416
        return new double[][]{ { 250, 45, 36, 66, 145, 80, 55  } };
451
        return null;
417
    }
452
    }
418
453
419
    public String[] getAxisLabels() {
454
    public String[] getAxisLabels() {
Lines 425-433 Link Here
425
            }
460
            }
426
            return labels;
461
            return labels;
427
        }
462
        }
428
        return new String[]{ "/", "/samples", "/jsp-samples", "/manager", "/manager/status", "/hello", "/world" };
463
        return null;
464
    }
465
466
    private String[] getLegendLabels() {
467
        String[] legends = new String[nbColToGraph];
468
        int i = 0;
469
        for (BarGraph bar : eltList) {
470
            if (bar.getChkBox().isSelected()) {
471
                legends[i] = bar.getLabel();
472
                i++;
473
            }
474
        }
475
        return legends;
476
    }
477
478
    private Color[] getBackColors() {
479
        Color[] backColors = new Color[nbColToGraph];
480
        int i = 0;
481
        for (BarGraph bar : eltList) {
482
            if (bar.getChkBox().isSelected()) {
483
                backColors[i] = bar.getBackColor();
484
                i++;
485
            }
486
        }
487
        return backColors;
429
    }
488
    }
430
489
490
    private int getNbColumns() {
491
        int i = 0;
492
        for (BarGraph bar : eltList) {
493
            if (bar.getChkBox().isSelected()) {
494
                i++;
495
            }
496
        }
497
        return i;
498
    }
499
    
431
    /**
500
    /**
432
     * We use this method to get the data, since we are using
501
     * We use this method to get the data, since we are using
433
     * ObjectTableModel, so the calling getDataVector doesn't
502
     * ObjectTableModel, so the calling getDataVector doesn't
Lines 453-460 Link Here
453
    public void actionPerformed(ActionEvent event) {
522
    public void actionPerformed(ActionEvent event) {
454
        final Object eventSource = event.getSource();
523
        final Object eventSource = event.getSource();
455
        if (eventSource == displayButton) {
524
        if (eventSource == displayButton) {
456
            makeGraph();
525
            if (model.getRowCount() > 1) {
457
            tabbedGraph.setSelectedIndex(1);
526
                makeGraph();
527
                tabbedGraph.setSelectedIndex(1);
528
            } else {
529
                JOptionPane.showMessageDialog(null, JMeterUtils
530
                        .getResString("aggregate_graph_no_values_to_graph"), // $NON-NLS-1$
531
                        JMeterUtils.getResString("aggregate_graph_no_values_to_graph"), // $NON-NLS-1$
532
                        JOptionPane.WARNING_MESSAGE);
533
            }
458
        } else if (eventSource == saveGraph) {
534
        } else if (eventSource == saveGraph) {
459
            saveGraphToFile = true;
535
            saveGraphToFile = true;
460
            try {
536
            try {
Lines 480-497 Link Here
480
            } finally {
556
            } finally {
481
                JOrphanUtils.closeQuietly(writer);
557
                JOrphanUtils.closeQuietly(writer);
482
            }
558
            }
483
        } else if (eventSource == chooseBarColor) {
484
            colorBarGraph = JColorChooser.showDialog(
485
                    null,
486
                    JMeterUtils.getResString("aggregate_graph_choose_color"), //$NON-NLS-1$
487
                    colorBarGraph);
488
            currentColor.setBackground(colorBarGraph);
489
        } else if (eventSource == chooseForeColor) {
559
        } else if (eventSource == chooseForeColor) {
490
            colorForeGraph = JColorChooser.showDialog(
560
            Color color = JColorChooser.showDialog(
491
                    null,
561
                    null,
492
                    JMeterUtils.getResString("aggregate_graph_choose_color"), //$NON-NLS-1$
562
                    JMeterUtils.getResString("aggregate_graph_choose_color"), //$NON-NLS-1$
493
                    colorBarGraph);
563
                    colorBarGraph);
494
            currentColor.setForeground(colorForeGraph);
564
            if (color != null) {
565
                colorForeGraph = color;
566
            }
495
        } else if (eventSource == syncWithName) {
567
        } else if (eventSource == syncWithName) {
496
            graphTitle.setText(namePanel.getName());
568
            graphTitle.setText(namePanel.getName());
497
        } else if (eventSource == dynamicGraphSize) {
569
        } else if (eventSource == dynamicGraphSize) {
Lines 521-526 Link Here
521
                FilePanel filePanel = (FilePanel) getFilePanel();
593
                FilePanel filePanel = (FilePanel) getFilePanel();
522
                filePanel.actionPerformed(event);
594
                filePanel.actionPerformed(event);
523
            }
595
            }
596
        } else if (eventSource instanceof JButton) {
597
            // Changing color for column
598
            JButton btn = ((JButton) eventSource);
599
            if (btn.getName() != null) {
600
                try {
601
                    BarGraph bar = eltList.get(Integer.parseInt(btn.getName()));
602
                    Color color = JColorChooser.showDialog(null, bar.getLabel(), bar.getBackColor());
603
                    if (color != null) {
604
                        bar.setBackColor(color);
605
                        btn.setBackground(bar.getBackColor());
606
                    }
607
                } catch (NumberFormatException nfe) { } // nothing to do
608
            }
524
        }
609
        }
525
    }
610
    }
526
611
Lines 555-598 Link Here
555
    }
640
    }
556
641
557
    private JPanel createGraphColumnPane() {
642
    private JPanel createGraphColumnPane() {
558
        JPanel barPanel = new JPanel();
643
        JPanel colPanel = new JPanel();
559
        barPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
644
        colPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
560
561
        barPanel.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_column"), //$NON-NLS-1$
562
                columnsList));
563
645
564
        currentColor.setBorder(new EmptyBorder(2, 5, 2, 5));
646
        JLabel label = new JLabel(JMeterUtils.getResString("aggregate_graph_columns_to_display")); //$NON-NLS-1$
565
        currentColor.setOpaque(true);
647
        colPanel.add(label);
566
        currentColor.setBackground(colorBarGraph);
648
        for (BarGraph bar : eltList) {
567
649
            colPanel.add(bar.getChkBox());
568
        barPanel.add(Box.createRigidArea(new Dimension(5,0)));
650
            colPanel.add(createColorBarButton(bar, eltList.indexOf(bar)));
569
        barPanel.add(currentColor);
651
        }
570
        barPanel.add(Box.createRigidArea(new Dimension(5,0)));
652
        colPanel.add(Box.createRigidArea(new Dimension(5,0)));
571
        barPanel.add(chooseBarColor);
653
        chooseForeColor.setFont(FONT_SMALL);
572
        chooseBarColor.addActionListener(this);
654
        colPanel.add(chooseForeColor);
573
        barPanel.add(Box.createRigidArea(new Dimension(5,0)));
574
        barPanel.add(chooseForeColor);
575
        chooseForeColor.addActionListener(this);
655
        chooseForeColor.addActionListener(this);
576
656
577
        barPanel.add(drawOutlinesBar);
657
        JPanel optionsPanel = new JPanel();
578
        barPanel.add(numberShowGrouping);
658
        optionsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
659
        optionsPanel.add(createGraphFontValuePane());
660
        optionsPanel.add(drawOutlinesBar);
661
        optionsPanel.add(numberShowGrouping);
662
        optionsPanel.add(valueLabelsVertical);
663
        
664
        JPanel barPane = new JPanel(new BorderLayout());
665
        barPane.add(colPanel, BorderLayout.NORTH);
666
        barPane.add(Box.createRigidArea(new Dimension(0,3)), BorderLayout.CENTER);
667
        barPane.add(optionsPanel, BorderLayout.SOUTH);
579
668
580
        JPanel columnPane = new JPanel(new BorderLayout());
669
        JPanel columnPane = new JPanel(new BorderLayout());
581
        columnPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
670
        columnPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
582
                JMeterUtils.getResString("aggregate_graph_column_settings"))); // $NON-NLS-1$
671
                JMeterUtils.getResString("aggregate_graph_column_settings"))); // $NON-NLS-1$
583
        columnPane.add(barPanel, BorderLayout.NORTH);
672
        columnPane.add(barPane, BorderLayout.NORTH);
584
        columnPane.add(Box.createRigidArea(new Dimension(5,0)), BorderLayout.CENTER);
673
        columnPane.add(Box.createRigidArea(new Dimension(0,3)), BorderLayout.CENTER);
585
        columnPane.add(createGraphSelectionSubPane(), BorderLayout.SOUTH);
674
        columnPane.add(createGraphSelectionSubPane(), BorderLayout.SOUTH);
586
        
675
        
587
        return columnPane;
676
        return columnPane;
588
    }
677
    }
589
    
678
679
    private JButton createColorBarButton(BarGraph barGraph, int index) {
680
        // Button
681
        JButton colorBtn = new JButton();
682
        colorBtn.setName(String.valueOf(index));
683
        colorBtn.setFont(FONT_SMALL);
684
        colorBtn.addActionListener(this);
685
        colorBtn.setBackground(barGraph.getBackColor());
686
        return colorBtn;
687
    }
688
590
    private JPanel createGraphSelectionSubPane() {
689
    private JPanel createGraphSelectionSubPane() {
591
        Font font = new Font("SansSerif", Font.PLAIN, 10);
690
        Font font = new Font("SansSerif", Font.PLAIN, 10);
592
        // Search field
691
        // Search field
593
        JPanel searchPanel = new JPanel();
692
        JPanel searchPanel = new JPanel();
594
        searchPanel.setLayout(new BoxLayout(searchPanel, BoxLayout.X_AXIS));
693
        searchPanel.setLayout(new BoxLayout(searchPanel, BoxLayout.X_AXIS));
595
        searchPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
694
        searchPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
596
695
597
        searchPanel.add(columnSelection);
696
        searchPanel.add(columnSelection);
598
        columnMatchLabel.setEnabled(false);
697
        columnMatchLabel.setEnabled(false);
Lines 644-649 Link Here
644
        return titlePane;
743
        return titlePane;
645
    }
744
    }
646
745
746
    private JPanel createGraphFontValuePane() {       
747
        JPanel fontValueStylePane = new JPanel();
748
        fontValueStylePane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
749
        fontValueStylePane.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_value_font"), //$NON-NLS-1$
750
                valueFontNameList));
751
        valueFontNameList.setSelectedIndex(0); // default: sans serif
752
        fontValueStylePane.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), //$NON-NLS-1$
753
                valueFontSizeList));
754
        valueFontSizeList.setSelectedItem(StatGraphProperties.fontSize[2]); // default: 10
755
        fontValueStylePane.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_style"), //$NON-NLS-1$
756
                valueFontStyleList));
757
        valueFontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.normal")); // default: normal //$NON-NLS-1$
758
759
        return fontValueStylePane;
760
    }
761
647
    private JPanel createGraphDimensionPane() {
762
    private JPanel createGraphDimensionPane() {
648
        JPanel dimensionPane = new JPanel();
763
        JPanel dimensionPane = new JPanel();
649
        dimensionPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
764
        dimensionPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
Lines 704-710 Link Here
704
819
705
        legendPanel.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_legend_placement"), //$NON-NLS-1$
820
        legendPanel.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_legend_placement"), //$NON-NLS-1$
706
                legendPlacementList));
821
                legendPlacementList));
707
        legendPlacementList.setSelectedItem(JMeterUtils.getResString("aggregate_graph_legend.placement.right")); // default: right
822
        legendPlacementList.setSelectedItem(JMeterUtils.getResString("aggregate_graph_legend.placement.bottom")); // default: bottom
708
        legendPanel.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_font"), //$NON-NLS-1$
823
        legendPanel.add(createLabelCombo(JMeterUtils.getResString("aggregate_graph_font"), //$NON-NLS-1$
709
                fontNameList));
824
                fontNameList));
710
        fontNameList.setSelectedIndex(0); // default: sans serif
825
        fontNameList.setSelectedIndex(0); // default: sans serif
(-)xdocs/usermanual/component_reference.xml (-2 / +2 lines)
Lines 2644-2657 Link Here
2644
</description>
2644
</description>
2645
</component>
2645
</component>
2646
2646
2647
<component name="Aggregate Graph" index="&sect-num;.3.12"  width="905" height="657" screenshot="aggregate_graph.png">
2647
<component name="Aggregate Graph" index="&sect-num;.3.12"  width="914" height="684" screenshot="aggregate_graph.png">
2648
<description>The aggregate graph is similar to the aggregate report. The primary
2648
<description>The aggregate graph is similar to the aggregate report. The primary
2649
difference is the aggregate graph provides an easy way to generate bar graphs and save
2649
difference is the aggregate graph provides an easy way to generate bar graphs and save
2650
the graph as a PNG file.</description>
2650
the graph as a PNG file.</description>
2651
<div align="center">
2651
<div align="center">
2652
<p>
2652
<p>
2653
    The figure below shows an example of settings to draw this graph.
2653
    The figure below shows an example of settings to draw this graph.
2654
<figure width="903" height="653" image="aggregate_graph_settings.png">Aggregate graph settings</figure>
2654
<figure width="913" height="443" image="aggregate_graph_settings.png">Aggregate graph settings</figure>
2655
</p>
2655
</p>
2656
</div>
2656
</div>
2657
</component>
2657
</component>
(-)xdocs/changes.xml (+1 lines)
Lines 173-178 Link Here
173
<ul>
173
<ul>
174
<li>Bug 52603 - MailerVisualizer : Enable SSL , TLS and Authentication</li>
174
<li>Bug 52603 - MailerVisualizer : Enable SSL , TLS and Authentication</li>
175
<li>Bug 52698 - Remove Graph Full Results Listener</li>
175
<li>Bug 52698 - Remove Graph Full Results Listener</li>
176
<li>Bug 53070 - Change Aggregate graph to Clustered Bar chart, add more columns (median, 90% line, min, max) and options, fixed some bugs</li>
176
</ul>
177
</ul>
177
178
178
<h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
179
<h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
(-)src/components/org/apache/jmeter/visualizers/BarGraph.java (+90 lines)
Line 0 Link Here
1
/* 
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 * 
9
 *   http://www.apache.org/licenses/LICENSE-2.0
10
 * 
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed  under the  License is distributed on an "AS IS" BASIS,
13
 * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
14
 * implied.
15
 * 
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
19
20
package org.apache.jmeter.visualizers;
21
22
import java.awt.Color;
23
24
import javax.swing.JCheckBox;
25
26
import org.apache.jmeter.util.JMeterUtils;
27
28
public class BarGraph {
29
    
30
    private String label;
31
    
32
    private JCheckBox chkBox;
33
    
34
    private Color backColor;
35
36
    /**
37
     * @param resString
38
     * @param checked
39
     * @param backColor
40
     */
41
    public BarGraph(String resString, boolean checked, Color backColor) {
42
        super();
43
        this.label = JMeterUtils.getResString(resString);
44
        this.chkBox = new JCheckBox(this.label, checked);
45
        this.backColor = backColor;
46
    }
47
48
    /**
49
     * @return the label
50
     */
51
    public String getLabel() {
52
        return label;
53
    }
54
55
    /**
56
     * @param label the label to set
57
     */
58
    public void setLabel(String label) {
59
        this.label = label;
60
    }
61
62
    /**
63
     * @return the chkBox
64
     */
65
    public JCheckBox getChkBox() {
66
        return chkBox;
67
    }
68
69
    /**
70
     * @param chkBox the chkBox to set
71
     */
72
    public void setChkBox(JCheckBox chkBox) {
73
        this.chkBox = chkBox;
74
    }
75
76
    /**
77
     * @return the backColor
78
     */
79
    public Color getBackColor() {
80
        return backColor;
81
    }
82
83
    /**
84
     * @param backColor the backColor to set
85
     */
86
    public void setBackColor(Color backColor) {
87
        this.backColor = backColor;
88
    }
89
    
90
}

Return to bug 53070