Search code examples
androidplot

AndroidPlot: Change label size


I am trying to draw custom text in the range label but I can't seem to figure out how I can set a custom size. I would like to measure my set of label items, and fix the label area to be large enough to hold that. Notice in the image below that the text doesn't fit in the space allocated for the range label. enter image description here


Solution

  • ~The text label size is variable for each edge of the plot. For example, to adjust the text size of the range labels on the the left edge (default) of the plot, add this to your plot's xml:~

    lineLabelTextSizeLeft="20sp"

    Updated Answer:

    You can add this to your plot's XML:

    ap:graphWidthMode="fill"
    ap:graphWidth="100dp"
    

    In fill mode, the graph takes the entire area minus the graphWidth you specify, relative to the graph anchor point (defaults to top-left).