Tabnine Logo
ScatterValue
Code IndexAdd Tabnine to your IDE (free)

How to use
ScatterValue
in
cn.jingzhuan.lib.chart.data

Best Java code snippets using cn.jingzhuan.lib.chart.data.ScatterValue (Showing top 5 results out of 315)

origin: donglua/JZAndroidChart

public ScatterChartModel() {
 final List<ScatterValue> scatterValues = new ArrayList<>();
 scatterValues.add(new ScatterValue(2));
 scatterValues.add(new ScatterValue(3));
 scatterValues.add(new ScatterValue(4));
 scatterValues.add(new ScatterValue(6));
 scatterValues.add(new ScatterValue(9));
 scatterValues.add(new ScatterValue(2));
 scatterValues.add(new ScatterValue(4));
 scatterValues.add(new ScatterValue(6));
 scatterValues.add(new ScatterValue(9));
 scatterValues.add(new ScatterValue(0));
 scatterValues.add(new ScatterValue(8));
 scatterValues.add(new ScatterValue(9));
 scatterValues.add(new ScatterValue(4));
 scatterValues.add(new ScatterValue(1));
 scatterValues.add(new ScatterValue(2));
 scatterDataSet = new ScatterDataSet(scatterValues);
 scatterDataSet.setAutoWidth(true);
}
origin: donglua/JZAndroidChart

private void calcViewportMinMax(ScatterValue e) {
 if (e.getValue() < mViewportYMin)
  mViewportYMin = e.getValue();
 if (e.getValue() > mViewportYMax)
  mViewportYMax = e.getValue();
}
origin: donglua/JZAndroidChart

ScatterValue point = dataSet.getEntryForIndex(i);
if (!point.isVisible()) continue;
float yPosition = (max - point.getValue()) / (max - min) * mContentRect.height() - shapeHeight * 0.5f;
point.setCoordinate(xPosition, yPosition);
if (point.getColor() != Color.TRANSPARENT) {
 dataSet.getShape().setColorFilter(point.getColor(), PorterDuff.Mode.SRC_OVER);
origin: donglua/JZAndroidChart

@Override public int getEntryIndexByCoordinate(float x, float y) {
 int index = -1;
 if (scatterData.getDataSets().size() > 0) {
  ScatterDataSet dataSet = scatterData.getDataSets().get(0);
  RectF rect = new RectF();
  float shapeWidth = dataSet.getShape().getIntrinsicWidth();
  float shapeHeight = dataSet.getShape().getIntrinsicHeight();
  for (int i = 0; i < dataSet.getValues().size(); i++) {
   final ScatterValue value = dataSet.getEntryForIndex(i);
   float pX = value.getX();
   float pY = value.getY();
   rect.set(pX, pY, pX + shapeWidth, pY + shapeHeight);
   if (rect.contains(x, y)) {
    index = i;
    break;
   }
  }
  return index;
 }
 return super.getEntryIndexByCoordinate(x, y);
}
origin: donglua/JZAndroidChart

public ScatterChart2Model() {
 final List<ScatterValue> scatterValues = new ArrayList<>();
 scatterValues.add(new ScatterValue(1f));
 scatterValues.add(new ScatterValue(2f));
 scatterValues.add(new ScatterValue(1f));
 scatterValues.add(new ScatterValue(2f));
 scatterValues.add(new ScatterValue(1f));
 scatterValues.add(new ScatterValue(2f));
 scatterDataSet = new ScatterDataSet(scatterValues);
 scatterDataSet.setMinValueOffsetPercent(0.5f);
 scatterDataSet.setMaxValueOffsetPercent(0.5f);
 scatterDataSet.setAutoWidth(false);
 scatterDataSet.addTextValueRenderer(new TextValueRenderer() {
  @Override public void render(Canvas canvas, Paint textPaint, int index, float x, float y) {
   textPaint.setTextSize(24f);
   canvas.drawText(textList.get(index), x, y, textPaint);
  }
 });
}
cn.jingzhuan.lib.chart.dataScatterValue

Javadoc

Created by donglua on 10/19/17.

Most used methods

  • <init>
  • getColor
  • getValue
  • getX
  • getY
  • isVisible
  • setCoordinate

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • ImageIO (javax.imageio)
  • JLabel (javax.swing)
  • JOptionPane (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now