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

How to use
Chart
in
lecho.lib.hellocharts.view

Best Java code snippets using lecho.lib.hellocharts.view.Chart (Showing top 20 results out of 315)

origin: com.github.lecho/hellocharts-library

@Override
public void cancelAnimation() {
  isAnimationStarted = false;
  handler.removeCallbacks(runnable);
  chart.animationDataFinished();
  animationListener.onAnimationFinished();
}
origin: com.github.lecho/hellocharts-library

@Override
public void onAnimationUpdate(ValueAnimator animation) {
  chart.animationDataUpdate(animation.getAnimatedFraction());
}
origin: com.github.lecho/hellocharts-library

public void resetTouchHandler() {
  this.computator = chart.getChartComputator();
  this.renderer = chart.getChartRenderer();
}
origin: jamorham/xDrip-plus

public Viewport advanceViewport(Chart chart, Chart previewChart, float hours) {
  viewport = new Viewport(previewChart.getMaximumViewport());
  viewport.inset((float) ((86400000 / hours) / FUZZER), 0);
  double distance_to_move = ((new Date().getTime()) / FUZZER) - viewport.left - (((viewport.right - viewport.left) / 2));
  viewport.offset((float) distance_to_move, 0);
  return viewport;
}
origin: com.github.lecho/hellocharts-library

@Override
public void resetRenderer() {
  this.computator = chart.getChartComputator();
}
origin: com.github.lecho/hellocharts-library

private void onChartDataOrSizeChanged() {
  initAxis(chart.getChartData().getAxisXTop(), TOP);
  initAxis(chart.getChartData().getAxisXBottom(), BOTTOM);
  initAxis(chart.getChartData().getAxisYLeft(), LEFT);
  initAxis(chart.getChartData().getAxisYRight(), RIGHT);
}
origin: com.github.lecho/hellocharts-library

@Override
public void onAnimationEnd(Animator animation) {
  chart.setCurrentViewport(targetViewport);
  animationListener.onAnimationFinished();
}
origin: com.github.lecho/hellocharts-library

selectionModeOldValue.clear();
if (wasTouched && !renderer.isTouched()) {
  chart.callTouchListener();
    chart.callTouchListener();
  chart.callTouchListener();
  renderer.clearTouch();
origin: NightscoutFoundation/xDrip

public Viewport advanceViewport(Chart chart, Chart previewChart, float hours) {
  viewport = new Viewport(previewChart.getMaximumViewport());
  viewport.inset((float) ((86400000 / hours) / FUZZER), 0);
  double distance_to_move = ((new Date().getTime()) / FUZZER) - viewport.left - (((viewport.right - viewport.left) / 2));
  viewport.offset((float) distance_to_move, 0);
  return viewport;
}
origin: com.github.lecho/hellocharts-library

public void resetRenderer() {
  this.computator = chart.getChartComputator();
}
origin: com.github.lecho/hellocharts-library

/**
 * Draw axes labels and names in the foreground.
 *
 * @param canvas
 */
public void drawInForeground(Canvas canvas) {
  Axis axis = chart.getChartData().getAxisYLeft();
  if (null != axis) {
    drawAxisLabelsAndName(canvas, axis, LEFT);
  }
  axis = chart.getChartData().getAxisYRight();
  if (null != axis) {
    drawAxisLabelsAndName(canvas, axis, RIGHT);
  }
  axis = chart.getChartData().getAxisXBottom();
  if (null != axis) {
    drawAxisLabelsAndName(canvas, axis, BOTTOM);
  }
  axis = chart.getChartData().getAxisXTop();
  if (null != axis) {
    drawAxisLabelsAndName(canvas, axis, TOP);
  }
}
origin: com.github.lecho/hellocharts-library

@Override
public void cancelAnimation() {
  isAnimationStarted = false;
  handler.removeCallbacks(runnable);
  chart.setCurrentViewport(targetViewport);
  animationListener.onAnimationFinished();
}
origin: jamorham/xDrip-plus

public Viewport advanceViewport(Chart chart, Chart previewChart) {
  viewport = new Viewport(previewChart.getMaximumViewport());
  viewport.inset((float) ((86400000 / 2.5) / FUZZER), 0);
  double distance_to_move = ((new Date().getTime())/ FUZZER) - viewport.left - (((viewport.right - viewport.left) /2));
  viewport.offset((float) distance_to_move, 0);
  return viewport;
}
origin: com.github.lecho/hellocharts-library

public ChartTouchHandler(Context context, Chart chart) {
  this.chart = chart;
  this.computator = chart.getChartComputator();
  this.renderer = chart.getChartRenderer();
  gestureDetector = new GestureDetector(context, new ChartGestureListener());
  scaleGestureDetector = new ScaleGestureDetector(context, new ChartScaleGestureListener());
  chartScroller = new ChartScroller(context);
  chartZoomer = new ChartZoomer(context, ZoomType.HORIZONTAL_AND_VERTICAL);
}
origin: com.github.lecho/hellocharts-library

private void insetContentRectWithAxesMargins(int axisMargin, int position) {
  if (LEFT == position) {
    chart.getChartComputator().insetContentRect(axisMargin, 0, 0, 0);
  } else if (RIGHT == position) {
    chart.getChartComputator().insetContentRect(0, 0, axisMargin, 0);
  } else if (TOP == position) {
    chart.getChartComputator().insetContentRect(0, axisMargin, 0, 0);
  } else if (BOTTOM == position) {
    chart.getChartComputator().insetContentRect(0, 0, 0, axisMargin);
  }
}
origin: com.github.lecho/hellocharts-library

@Override
public void onChartDataChanged() {
  final ChartData data = chart.getChartData();
  Typeface typeface = chart.getChartData().getValueLabelTypeface();
  if (null != typeface) {
    labelPaint.setTypeface(typeface);
  }
  labelPaint.setColor(data.getValueLabelTextColor());
  labelPaint.setTextSize(ChartUtils.sp2px(scaledDensity, data.getValueLabelTextSize()));
  labelPaint.getFontMetricsInt(fontMetrics);
  this.isValueLabelBackgroundEnabled = data.isValueLabelBackgroundEnabled();
  this.isValueLabelBackgroundAuto = data.isValueLabelBackgroundAuto();
  this.labelBackgroundPaint.setColor(data.getValueLabelBackgroundColor());
  // Important - clear selection when data changed.
  selectedValue.clear();
}
origin: com.github.lecho/hellocharts-library

@Override
public void onAnimationUpdate(ValueAnimator animation) {
  float scale = animation.getAnimatedFraction();
  float diffLeft = (targetViewport.left - startViewport.left) * scale;
  float diffTop = (targetViewport.top - startViewport.top) * scale;
  float diffRight = (targetViewport.right - startViewport.right) * scale;
  float diffBottom = (targetViewport.bottom - startViewport.bottom) * scale;
  newViewport.set(startViewport.left + diffLeft, startViewport.top + diffTop, startViewport.right + diffRight,
      startViewport.bottom + diffBottom);
  chart.setCurrentViewport(newViewport);
}
origin: com.github.lecho/hellocharts-library

@Override
public void onAnimationEnd(Animator animation) {
  chart.animationDataFinished();
  animationListener.onAnimationFinished();
}
origin: com.github.lecho/hellocharts-library

@Override
public void onChartSizeChanged() {
  final ChartComputator computator = chart.getChartComputator();
  Rect contentRect = computator.getContentRectMinusAllMargins();
  if (contentRect.width() < contentRect.height()) {
    isBubbleScaledByX = true;
  } else {
    isBubbleScaledByX = false;
  }
}
origin: com.github.lecho/hellocharts-library

/**
 * Prepare axes coordinates and draw axes lines(if enabled) in the background.
 *
 * @param canvas
 */
public void drawInBackground(Canvas canvas) {
  Axis axis = chart.getChartData().getAxisYLeft();
  if (null != axis) {
    prepareAxisToDraw(axis, LEFT);
    drawAxisLines(canvas, axis, LEFT);
  }
  axis = chart.getChartData().getAxisYRight();
  if (null != axis) {
    prepareAxisToDraw(axis, RIGHT);
    drawAxisLines(canvas, axis, RIGHT);
  }
  axis = chart.getChartData().getAxisXBottom();
  if (null != axis) {
    prepareAxisToDraw(axis, BOTTOM);
    drawAxisLines(canvas, axis, BOTTOM);
  }
  axis = chart.getChartData().getAxisXTop();
  if (null != axis) {
    prepareAxisToDraw(axis, TOP);
    drawAxisLines(canvas, axis, TOP);
  }
}
lecho.lib.hellocharts.viewChart

Javadoc

Interface for all charts. Every chart must implements this interface but chart doesn't really have to extends View or ViewGroup class. It can be any java class for example chart that only draw on in-memory bitmap and saves it on sd card.

Most used methods

  • getMaximumViewport
    Returns maximum viewport for this chart. Don't modify it directly, use #setMaximumViewport(Viewport)
  • animationDataFinished
    Called when data animation finished.
  • animationDataUpdate
    Updates chart data with given scale. Called during chart data animation update.
  • callTouchListener
  • getChartComputator
  • getChartData
    Returns generic chart data. For specific class call get*ChartData method from data provider implemen
  • getChartRenderer
  • setCurrentViewport
    Sets current viewport. Note. viewport have to be set after chartData has been set.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Vim plugins
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