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

Moved ChartUtils drawing methods into CGContext extension #3086

Merged
merged 16 commits into from
Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from 15 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
830 changes: 419 additions & 411 deletions Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ChartsDemo/Objective-C/Demos/CombinedChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ - (BarChartData *)generateBarData
[set1 setColor:[UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f]];
set1.valueTextColor = [UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f];
set1.valueFont = [UIFont systemFontOfSize:10.f];
set1.axisDependency = AxisDependencyLeft;
set1.axisDependency = AxisDependencyRight;

BarChartDataSet *set2 = [[BarChartDataSet alloc] initWithValues:entries2 label:@""];
set2.stackLabels = @[@"Stack 1", @"Stack 2"];
Expand All @@ -216,7 +216,7 @@ - (BarChartData *)generateBarData
];
set2.valueTextColor = [UIColor colorWithRed:61/255.f green:165/255.f blue:255/255.f alpha:1.f];
set2.valueFont = [UIFont systemFontOfSize:10.f];
set2.axisDependency = AxisDependencyLeft;
set2.axisDependency = AxisDependencyRight;

float groupSpace = 0.06f;
float barSpace = 0.02f; // x2 dataset
Expand Down
64 changes: 49 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ def type
end

def project_name
'Charts.xcodeproj'
'ChartsDemo/ChartsDemo.xcodeproj'
end

def macos_project_name
'ChartsDemo-OSX/ChartsDemo-OSX.xcodeproj'
end

def configuration
Expand All @@ -29,6 +33,19 @@ def build_schemes
]
end

def build_demo_schemes
%i[
ChartsDemo
ChartsDemo-Swift
]
end

def build_macos_demo_schemes
[
'ChartsDemo-OSX'
]
end

def test_schemes
[
'ChartsTests'
Expand Down Expand Up @@ -74,33 +91,43 @@ def xcodebuild(type, name, scheme, configuration, sdk, destination, tasks, xcpre
sh "set -o pipefail && xcodebuild #{project_type} '#{name}' -scheme '#{scheme}' -configuration '#{configuration}' -sdk #{sdk} -destination #{destination} #{tasks} | bundle exec xcpretty -c #{xcprety_args}"
end

def run_xcodebuild(schemes_to_execute, tasks, destination, is_test, xcprety_args)
def run_xcodebuild(tasks, destination, is_build_demo, xcprety_args)
sdk = destination[:sdk]
device = destination[:device]
uuid = destination[:uuid]

is_test = tasks.include?('test')
is_macos = sdk == 'macosx'

project = is_macos ? macos_project_name : project_name

schemes_to_execute = []
if is_test
schemes_to_execute = test_schemes
elsif is_build_demo
schemes_to_execute = is_macos ? build_macos_demo_schemes : build_demo_schemes
else
schemes_to_execute = build_schemes
end

open_simulator_and_sleep uuid if is_test

schemes_to_execute.each do |scheme|
xcodebuild type, project_name, scheme, configuration, sdk, device, tasks, xcprety_args
xcodebuild type, project, scheme, configuration, sdk, device, tasks, xcprety_args
end
end

def execute(tasks, platform, xcprety_args: '')
is_test = tasks.include?('test')

def execute(tasks, platform, is_build_demo = false, xcprety_args: '')
# platform specific settings
destination = devices[platform]

schemes = is_test ? test_schemes : build_schemes

# check if xcodebuild needs to be run on multiple devices
if destination.is_a?(Array)
destination.each do |destination|
run_xcodebuild schemes, tasks, destination, is_test, xcprety_args
run_xcodebuild tasks, destination, is_build_demo, xcprety_args
end
else
run_xcodebuild schemes, tasks, destination, is_test, xcprety_args
run_xcodebuild tasks, destination, is_build_demo, xcprety_args
end
end

Expand All @@ -122,11 +149,18 @@ end
desc 'Run CI tasks. Build and test or build depending on the platform.'
task :ci, [:platform] do |_task, args|
platform = arg_to_key(args[:platform]) if args.key?(:platform)

if test_platforms.include?(platform)
execute 'clean test', platform
elsif build_platforms.include?(platform)
execute 'clean build', platform
is_build_demo = test_platforms.include?(platform) || build_platforms.include?(platform)

if test_platforms.include?(platform) # iOS and tvOS
if platform == :iOS
execute 'clean', platform, is_build_demo
execute 'build', platform, is_build_demo
execute 'test', platform # not use demo specifically
else
execute 'clean test', platform
end
elsif build_platforms.include?(platform) # macOS
execute 'clean build', platform, is_build_demo
else
test_platforms.each do |platform|
execute 'clean test', platform
Expand Down
4 changes: 2 additions & 2 deletions Source/Charts/Charts/BarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider
}

// calculate axis range (min / max) according to provided data
_leftAxis.calculate(
leftAxis.calculate(
min: data.getYMin(axis: .left),
max: data.getYMax(axis: .left))
_rightAxis.calculate(
rightAxis.calculate(
min: data.getYMin(axis: .right),
max: data.getYMax(axis: .right))
}
Expand Down
Loading