• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

cewolf meter chart

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using cewolf 1.1, prepared by ulfdittmer. I am using the meter chart for my application. But making showlegend to false for meter chart does not hide the legend. Can anybody please tell me how to hide the legend.
Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The various meter charts never honored that parameter. I've uploaded a new version that fixes this, and which also has a postprocessor (MeterEnhancer) for setting some other parameters.
 
sourav dalal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your solution. My new problem is that,While using MeterPostProcessor , I have increased the BasicStroke of MeterInterval to 20.0f. But in case of display the chord is trimmed at upper level.
I am attaching the code for meter postprocessor for processchart function:

public void processChart (Object chart, Map params) {
MeterPlot plot = (MeterPlot) ((JFreeChart) chart).getPlot();
double min = 0;
double max = 180;
plot.setMeterAngle(180);
plot.setNeedlePaint(Color.BLACK);
plot.setDialBackgroundPaint(Color.white);
plot.setDrawBorder(true);
plot.setDialShape(DialShape.CHORD);
//plot.setDialBackgroundPaint(Color.ORANGE);
plot.setOutlineVisible(true);
plot.setRange(new Range(min, max));
plot.addInterval(new MeterInterval("Normal",new Range(0, 60),Color.green, new BasicStroke(20.0f, BasicStroke.CAP_BUTT, BasicStroke.CAP_BUTT), null));
plot.addInterval(new MeterInterval("Warning",new Range(60, 120),Color.yellow, new BasicStroke(20.0f,BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER), null));
plot.addInterval(new MeterInterval("Critical",new Range(120, 180),Color.red, new BasicStroke(20.0f,BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER), null));
plot.valueToAngle(0.0f);
plot.setUnits("km/h");
}
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the problem that not the full width is visible? If so, that's probably unavoidable. The chart drawing code does not take extra-wide graphics into account.
 
sourav dalal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's the problem. Can you suggest any alternative? Is it possible by ,putting negative values in stroke to produce the width inward. Though ,that does not work. But is it possible to do?
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic