Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entry, dataset and chartdata serializable #196

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.datasets.IDataSet;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -18,7 +19,7 @@
*
* @author Philipp Jahoda
*/
public abstract class ChartData<T extends IDataSet<? extends Entry>> {
public abstract class ChartData<T extends IDataSet<? extends Entry>> implements Serializable {

/**
* maximum y-value in the value array across all axes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

package com.github.mikephil.charting.data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -12,7 +13,7 @@
*
* @author Philipp Jahoda
*/
public abstract class DataSet<T extends Entry> extends BaseDataSet<T> {
public abstract class DataSet<T extends Entry> extends BaseDataSet<T> implements Serializable {

/**
* the entries that this DataSet represents / holds together
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@

import com.github.mikephil.charting.utils.Utils;

import java.io.Serializable;

/**
* Class representing one entry in the chart. Might contain multiple values.
* Might only contain a single value depending on the used constructor.
*
*
* @author Philipp Jahoda
*/
public class Entry extends BaseEntry implements Parcelable {
public class Entry extends BaseEntry implements Parcelable, Serializable {

/** the x value */
/**
* the x value
*/
private float x = 0f;

public Entry() {
Expand All @@ -37,8 +41,8 @@ public Entry(float x, float y) {
/**
* A Entry represents one single entry in the chart.
*
* @param x the x value
* @param y the y value (the actual value of the entry)
* @param x the x value
* @param y the y value (the actual value of the entry)
* @param data Spot for additional data this Entry represents.
*/
public Entry(float x, float y, Object data) {
Expand Down Expand Up @@ -73,7 +77,7 @@ public Entry(float x, float y, Drawable icon, Object data) {

/**
* Returns the x-value of this Entry object.
*
*
* @return
*/
public float getX() {
Expand All @@ -82,7 +86,7 @@ public float getX() {

/**
* Sets the x-value of this Entry object.
*
*
* @param x
*/
public void setX(float x) {
Expand All @@ -91,7 +95,7 @@ public void setX(float x) {

/**
* returns an exact copy of the entry
*
*
* @return
*/
public Entry copy() {
Expand All @@ -103,7 +107,7 @@ public Entry copy() {
* Compares value, xIndex and data of the entries. Returns true if entries
* are equal in those points, false if not. Does not check by hash-code like
* it's done by the "equals" method.
*
*
* @param e
* @return
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider;
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;

import java.io.Serializable;

/**
* Default formatter that calculates the position of the filled line.
*
* @author Philipp Jahoda
*/
public class DefaultFillFormatter implements IFillFormatter
{
public class DefaultFillFormatter implements IFillFormatter, Serializable {

@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

import com.github.mikephil.charting.components.YAxis;

import java.io.Serializable;

/**
* Contains information needed to determine the highlighted value.
*
* @author Philipp Jahoda
*/
public class Highlight {
public class Highlight implements Serializable {

/**
* the x-value of the highlighted value
Expand Down
Loading