Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:42:56+00:00 2026-06-02T03:42:56+00:00

Anyone that has used the AndroidPlot library tell me how would I go about

  • 0

Anyone that has used the AndroidPlot library tell me how would I go about drawing custom points on a graph. So far I’m using LineAndPointRenderer class and settings lines to transparent.
I would like to at least change the size of the dot but if possible have a custom image instead.

P.S someone with 1500 rep needs to create a “AndroidPlot” tag.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:43:00+00:00Added an answer on June 2, 2026 at 3:43 am

    Solved the problem by creating my own renderer.

    import android.graphics.*;
    
    import com.androidplot.series.XYSeries;
    import com.androidplot.exception.PlotRenderException;
    import com.androidplot.util.ValPixConverter;
    import com.androidplot.xy.LineAndPointFormatter;
    import com.androidplot.xy.XYPlot;
    import com.androidplot.xy.XYSeriesRenderer;
    
    
    public class CustomPointRenderer<FormatterType extends LineAndPointFormatter> extends XYSeriesRenderer<FormatterType> {
    
        private float circleWidth = 1;
    
        public CustomPointRenderer(XYPlot plot) {
            super(plot);
        }
    
        @Override
        public void onRender(Canvas canvas, RectF plotArea) throws PlotRenderException {
            for(XYSeries series : getPlot().getSeriesListForRenderer(this.getClass())) {
                drawSeries(canvas, plotArea, series, getFormatter(series));
            }
        }
        @Override
        protected void doDrawLegendIcon(Canvas canvas, RectF rect, FormatterType formatter) {
            // horizontal icon:
            float centerY = rect.centerY();
            float centerX = rect.centerX();
    
            if(formatter.getFillPaint() != null) {
                canvas.drawRect(rect, formatter.getFillPaint());
            }
            if(formatter.getLinePaint() != null) {
                canvas.drawLine(rect.left, rect.bottom, rect.right, rect.top, formatter.getLinePaint());
            }
    
            if(formatter.getVertexPaint() != null) {
                canvas.drawPoint(centerX, centerY, formatter.getVertexPaint());
            }
        }
    
        private void drawSeries(Canvas canvas, RectF plotArea, XYSeries series, LineAndPointFormatter formatter) throws PlotRenderException {
            PointF p = null;
            XYPlot plot = getPlot();
            int size = series.size();
    
            for (int i = 0; i < size; i++) {
                Number y = series.getY(i);
                Number x = series.getX(i);
    
                if (y != null && x != null) {
                    p = ValPixConverter.valToPix(x, y, plotArea,
                                plot.getCalculatedMinX(),
                                plot.getCalculatedMaxX(),
                                plot.getCalculatedMinY(),
                                plot.getCalculatedMaxY());
    
                    if (formatter.getVertexPaint() != null) {
                        boolean offScreen = p.x > plotArea.right || p.y > plotArea.bottom || p.x < plotArea.left || p.y < plotArea.top; 
                        if(!offScreen)
                            canvas.drawCircle(p.x, p.y - circleWidth, circleWidth, formatter.getVertexPaint());
                    }               
                }
            } 
        }
    
        public void setWidth(float width){
            circleWidth = width;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone seen an open-source library that produces charts similar to Github.com's commit timeline
I am wondering if anyone has used or read about PHP scripts compiled as
A question for anyone who has used the Java library Mallet's SimpleTagger class for
Has anyone used CSLA in an application that has a WPF front end and
Does anyone know of a jQuery plugin that has 'helpers' or extensions like those
Does anyone know of an editor that has the ability to enforce exact line
Does anyone know of a List implementation that has a constant time get(int index)
Does anyone know of a bug tracking piece of software that has community based
Now that Google Earth has been released for Android 2.1, does anyone know what,
Has anyone written a macro that will remove and sort your usings in an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.