Plotting horizontal markers on Histogram
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Plotting horizontal markers on Histogram

  1. #1
    Join Date
    May 2009
    Posts
    2

    Plotting horizontal markers on Histogram

    I'm using the code mentioned below to plot the horizontal lines on histogram but its not working.


    double delta = (va.getRange().getLength()/100);
    double mean = computeMean(yAxisValues);
    double std = computeStandardDeviation(yAxisValues,mean);
    double first = (mean + std);
    double second = (mean - std);

    //ADDING A MARKER AT MEAN + STD
    log.debug("$$$$$$$$$" + sigmalinetype);
    if(sigmalinetype == 1 || sigmalinetype == 2 ){

    Marker target = new IntervalMarker(first,first+delta);
    target.setPaint(Color.red);
    target.setLabelAnchor(RectangleAnchor.LEFT);
    target.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
    plot.addRangeMarker(target, Layer.BACKGROUND);
    plot.addDomainMarker(target);

    }
    //ADDING A MARKER AT MEAN - STD
    if(sigmalinetype == 1 || sigmalinetype == 3 ){
    Marker target1 = new IntervalMarker(second,second+delta);
    target1.setPaint(Color.red);
    target1.setLabelAnchor(RectangleAnchor.LEFT);
    target1.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
    plot.addRangeMarker(target1, Layer.BACKGROUND);
    plot.addDomainMarker(target1);
    }

    The same code I have used in scatter chart to plot the markers and its working.Any help in this regard would be gr8ly appreciated.

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Plotting horizontal markers on Histogram

    It would probably help if you explained where the Marker and IntervalMarker classes come from and what variable 'plot' is.

    The skill of writing is to create a context in which other people can think...
    E. Schlossberg
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center