ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Gagues not showing what expected..
Posted by Brian Cuthbertson on Jun-06-2016 20:10
Attachments:
Hi Peter,

Ad the title states, I am not getting what I expect from this code.

What I expect is the guage to be in the middle.

What I get is what ids shown in the image.


            double value = 100.0;
            var m = new AngularMeter(200, 300, 0xffffff, 0xffffff, 0);
            m.setSearchPath(Server.MapPath("."));
            m.setMeter(25, 150, 150, 135, 45);
            m.setScale2(-100, 200, new string[] { "E", " ", " ", " ", "F" });
            m.setLineWidth(2, 2);
            m.addZone(80, 110, 0x00ff00);
            m.addPointer(value, 0xffff00);
            var wv = new WebChartViewer { Image = m.makeWebImage(Chart.PNG) };
            graphHolder.Controls.Add(wv);


wat do?

brian
guage.png

  Re: Gauge not showing what expected..
Posted by Brian Cuthbertson on Jun-06-2016 21:23
I should have mentioned, with a scale of -100 to 100, and the value set to 100 I'd expect the gauge to point to the middle.. not where it is in the picture.

  Re: Gauge not showing what expected..
Posted by Peter Kwan on Jun-07-2016 01:48
Hi Brian,

Sorry, I am not too sure what is your exact requirement.

In your current code, the scale is from -100 to 200, as your code use setScale2(-100, 200, ...). So the "middle" is (-100 + 200) / 2 = 50, and so 100 should be above the middle, which is the case in your meter.

You mentioned "with a scale of -100 to 100, and the value set to 100 I'd expect the gauge to point to the middle". If the scale is from -100 to 100, then the value of 100 should point to the end of the enter (the "F" position), not the middle. The middle between -100 and 100 should be 0.

If you want the 100 position to be at the middle, you can set the scale from -100 to 300. For example:

m.setScale2(-100, 300, new string[] { "E", " ", " ", " ", "F" });

If the above is not what you need, would you mind to clarify the statement "with a scale of -100 to 100, and the value set to 100 I'd expect the gauge to point to the middle"? It is because I think if the scale is -100 to 100, the 100 is at the end of the scale, not the middle.

Regards
Peter Kwan