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

How to use
RadarView
in
jsc.kit.component.radarview

Best Java code snippets using jsc.kit.component.radarview.RadarView (Showing top 3 results out of 315)

origin: JustinRoom/JSCKit

/**
 * 计算value顶点
 *
 * @param startAngle
 * @param radarEntities
 * @param maxRadius
 * @return
 */
private List<RadarPoint> getDataPoints(int startAngle, float maxRadius, List<RadarEntity> radarEntities) {
  List<RadarPoint> points = new ArrayList<>();
  int count = radarEntities.size();
  int avgAngle = 360 / count;
  for (int i = 0; i < count; i++) {
    RadarEntity entity = radarEntities.get(i);
    int angle = startAngle + avgAngle * i;
    float tempRadius = maxRadius * entity.getValue();
    RadarPoint point = getPointAtSpecialAngle(angle, getWidth() / 2.0f, getWidth() / 2.0f, tempRadius);
    points.add(point);
  }
  return points;
}
origin: JustinRoom/JSCKit

  return;
int maxHPadding = Math.max(getPaddingLeft(), getPaddingRight());
int maxVPadding = Math.max(getPaddingTop(), getPaddingBottom());
float maxRadius = getWidth() / 2.0f - layerStrokeWidth - Math.max(maxHPadding, maxVPadding);
int count = radarEntities.size();
for (int i = 0; i < layerCount; i++) {
  float tempRadius = maxRadius - maxRadius * i / layerCount;
  List<RadarPoint> points = getPointsOnCircle(startAngle, count, getWidth() / 2.0f, getWidth() / 2.0f, tempRadius);
  drawPolygon(canvas, points, paint);
  pointLists.add(points);
    RadarPoint point1 = pointLists.get(0).get(i);
    RadarPoint point2 = pointLists.get(layerCount - 1).get(i);
    drawPolygonLine(canvas, point1, point2, paint);
drawPolygon(canvas, getDataPoints(startAngle, maxRadius, radarEntities), paint);
  drawLabel(canvas, radarEntities.get(i), point, textPaint, vertexRadius + 8);
origin: JustinRoom/JSCKit

/**
 * 计算多边形顶点
 *
 * @param startAngle
 * @param count
 * @param centerX
 * @param centerY
 * @param radius
 * @return
 */
private List<RadarPoint> getPointsOnCircle(int startAngle, int count, float centerX, float centerY, float radius) {
  List<RadarPoint> points = new ArrayList<>();
  int avgAngle = 360 / count;
  for (int i = 0; i < count; i++) {
    int angle = startAngle + avgAngle * i;
    points.add(getPointAtSpecialAngle(angle, centerX, centerY, radius));
  }
  return points;
}
jsc.kit.component.radarviewRadarView

Javadoc


Email:1006368252@qq.com
QQ:1006368252
https://github.com/JustinRoom/JSCKit

Most used methods

  • drawLabel
    画标签
  • drawPolygon
    画正多边形
  • drawPolygonLine
    画正多边形相对应顶点的连线
  • getDataPoints
    计算value顶点
  • getPaddingBottom
  • getPaddingLeft
  • getPaddingRight
  • getPaddingTop
  • getPointAtSpecialAngle
  • getPointsOnCircle
    计算多边形顶点
  • getResources
  • getWidth
  • getResources,
  • getWidth,
  • postInvalidate,
  • setRadarEntities

Popular in Java

  • Reactive rest calls using spring rest template
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 12 Jupyter Notebook extensions
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