if(legend == null && gt.legend()) { legend = name;
/** * Fill a GraphDef with values as defined by the graph desc * * @param graphDef the GraphDef to configure * @param defProbe The probe to get values from * @param customData some custom data, they override existing values in the * associated probe */ public void fillGraphDef(RrdGraphDef graphDef, Probe<?, ?> defProbe, ExtractInfo ei, Map<String, ? extends Plottable> customData) { List<DsDesc> toDo = DatasourcesPopulator.populate(graphDef, defProbe, ei, customData, allds, name); // The title line, only if values block is required if(withSummary) { graphDef.comment(""); // We simulate the color box graphDef.comment(MANYSPACE.substring(0, Math.min(maxLengthLegend, MANYSPACE.length() - 2) + 4)); graphDef.comment("Current"); graphDef.comment(" Average"); graphDef.comment(" Minimum"); graphDef.comment(" Maximum"); graphDef.comment("\\l"); } String shortLegend = withSummary ? " \\g" : null; for(DsDesc ds: toDo) { ds.graphType.draw(graphDef, ds.name, ds.color, shortLegend); if(withSummary && ds.graphType.legend()) addLegend(graphDef, ds.name, ds.graphType, ds.legend); } }
public int getLegendLines() { int numlegend = 0; for(DsDesc dd: allds) { if(dd.graphType.legend() && dd.legend != null && withSummary) numlegend++; } return numlegend; }