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

Set axes color and added AxesTextColor property #3316

Open
wants to merge 5 commits into
base: ucr
Choose a base branch
from

Conversation

ghu999
Copy link
Contributor

@ghu999 ghu999 commented Jan 8, 2025

General items:

If your code changes how something works on the device (i.e., it affects the companion):

  • I branched from ucr
  • My pull request has ucr as the base

Further, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):

  • I have updated the corresponding version number in appinventor/components/src/.../common/YaVersion.java
  • I have updated the corresponding upgrader in appinventor/appengine/src/.../client/youngandroid/YoungAndroidFormUpgrader.java (components only)
  • I have updated the corresponding entries in appinventor/blocklyeditor/src/versioning.js

For all other changes:

  • I branched from master
  • My pull request has master as the base

What does this PR accomplish?

Description

Fixes # .

Resolves # .

@AppInventorWorkerBee
Copy link
Collaborator

Can one of the admins verify this patch?

@@ -47,6 +47,7 @@ open class AxisChartView : ChartView {
(chart as? BarLineChartViewBase)?.leftAxis.granularity = 1
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

We probably don't need an extra blank line.

@ewpatton
Copy link
Member

ewpatton commented Jan 8, 2025

Some todos once this is further along:

  • Bump version numbers in YaVersion
  • Implement upgrade paths in YoungAndroidFormUpgrader
  • Implement upgrade paths in versioning.js

@ghu999 ghu999 self-assigned this Jan 15, 2025
@ewpatton ewpatton added this to the nb201 milestone Jan 16, 2025
@ghu999 ghu999 force-pushed the feature-axestextcolor branch from 0b7d115 to a2bc8c9 Compare February 11, 2025 18:26
Copy link
Member

@ewpatton ewpatton left a comment

Choose a reason for hiding this comment

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

Here are some things I've noted. We can discuss more next time you're in the lab.

@@ -47,6 +47,7 @@ open class AxisChartView : ChartView {
(chart as? BarLineChartViewBase)?.leftAxis.granularity = 1
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Please reset this file as mentioned.

@@ -99,6 +99,7 @@ public void setColor(int argb) {
}
}


Copy link
Member

Choose a reason for hiding this comment

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

Please reset this file since this is a whitespace only change.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like you need to add the function for upgrading the ChartData2D component.

return colorToArgb(_axesTextColor)
}
set {
_axesTextColor = argbToColor(newValue)
Copy link
Member

Choose a reason for hiding this comment

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

Make sure to appropriately handle if newValue is COLOR_DEFAULT, which itself is a 0-alpha value that would otherwise make the text invisible.

@@ -12,6 +12,8 @@ import DGCharts
var _color: Int32 = AIComponentKit.Color.black.int32
var _colors: [UIColor] = []
var _label: String?

var _dataLabelColor: Int32 = AIComponentKit.Color.black.int32
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to make this conditional on dark theme similar to what you did in Chart.swift?

Copy link
Member

Choose a reason for hiding this comment

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

We will need to reset this since the change is already in ucr.

@@ -51,4 +53,14 @@ protected void initializeDefaultSettings() {
public View getView() {
return chart;
}
/**
Copy link
Member

Choose a reason for hiding this comment

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

Code style: Include a blank line before the Javadoc to visually separate it from the previous function body.

@@ -57,6 +61,8 @@ protected ChartDataBase(Chart chartContainer) {
Color(Component.COLOR_BLACK);
DataSourceKey("");
Label("");

DataLabelColor(Component.COLOR_BLACK);
Copy link
Member

Choose a reason for hiding this comment

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

See my note on the iOS version about whether we need to adjust this for dark theme.

@ewpatton ewpatton self-assigned this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants