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

Displayed points for series in the graph. #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Displayed points for series in the graph. #15

wants to merge 2 commits into from

Conversation

pryaniq
Copy link

@pryaniq pryaniq commented Nov 12, 2015

How use:
yourSeriesName1.points = true
yourSeriesName1.points = false
chart.poinstWidth = 2.0

2015-11-12 12 07 18

How use:
yourSeriesName1.points = true
yourSeriesName1.points = false
chart.poinstWidth = 2.0
@@ -291,6 +297,12 @@ class Chart: UIControl {

if series.line {
drawLine(xValues: scaledXValues, yValues: scaledYValues, seriesIndex: index)
if series.points {
for i in 1..<scaledXValues.count {
drawPoints(xValues: scaledXValues, yValues: scaledYValues, seriesIndex: index, i: i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand it, drawPoints actually draws only one point for the coordinates at the i position. I'm confused by the plural in the method name. Why pass all the xValues and yValues as arguments?

@gpbl
Copy link
Owner

gpbl commented Dec 4, 2015

Hi @pryaniq thanks for your PR! I really appreciate the help. The points (better called markers) are a nice addition to the chart.

However I think we should provide a way to use a custom marker, e.g. I would not hard code the layer into the Chart class. I wonder also if we should provide methods for touch events.

There are some things in the code I have not clear – and performance improvements I'd like to apply (see comments). Would you mind to discuss the feature before going on with the PR?

@gpbl
Copy link
Owner

gpbl commented Dec 5, 2015

For example, each ChartSerie may have its own marker definition.

@pryaniq
Copy link
Author

pryaniq commented Dec 5, 2015

@gpbl thanks for review. I will try to fix the code, according to the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants