Comments (10)
This probably falls into this as well, I appears as a chart won't accept any other frame than the one it has been initialised with.
For instance, I initialize a chart with a frame of 0,0,50,50. Later in 'layoutSubviews' a new frame with new dimensions will be set. And even after manually calling 'setNeedsLayout / setNeedsDisplay' on the chart, it doesn't accept the new frame.
Anyone else experiencing this as well?
from charts.
In ChartViewBase.swift there's a bounds
override, around line 750.
Could you please see if the viewport is actually updated there while
debugging?
I'm not on a Mac at the moment and perhaps we can make a quick fix now!
from charts.
Sorry, just read your comment now. Is there a way to debug this from an Objective-C project? I can't look into the variables when I set a breakpoint in the code you've mentioned.
from charts.
Maybe println?
Or just a breakpoint to make sure it reaches there after resizing?
I know there are still some bugs when debugging Swift...
On Wed, Apr 29, 2015 at 6:40 PM, AlBirdie [email protected] wrote:
Sorry, just read your comment now. Is there a way to debug this from an
Objective-C project? I can't look into the variables when I set a
breakpoint in the code you've mentioned.—
Reply to this email directly or view it on GitHub
#49 (comment)
.
from charts.
Sorry for not getting back to your earlier Daniel, just got back in the office.
I don't think this issue has been fixed by overriding frame instead of bounds. Just run the demo project with the latest source code, open the line chart demo and rotate the device. At first the viewport is getting stretched, but once you click into the chart (so that it reloads), it'll go back to its original frame.
from charts.
from charts.
Yes, somehow mixed up the code bases. :) So it does rotate.
However, setting the frame manually (i.e. in ViewController's layoutSubviews) still won't work. The chart keeps the frame that has been set initially. This time I'm working with the latest code. ;) I've tried to debug this myself, but to be completely honest, I've got no idea why it isn't working.
from charts.
from charts.
Pretty sure, yes. I'm not even using a StoryBoard (nor layout constraints for that matter).
This is just a regular UIViewController with a chart added in code. In the viewcontroller's layoutSubviews I explicitly set the frame to the viewcontroller's frame, which won't have any effect.
You can even set a completely random frame in layoutSubviews (200 x 200 or something like that), and it won't resize the chart.
As a matter of fact, you can quite easily reproduce this bug by adapting the LineChart1ViewController by removing the LineChartView from the xib file and add it manually by code;
_chartView = [[LineChartView alloc] initWithFrame:CGRectMake(20, 20, 200, 200)];
[self.view addSubview:_chartView];
Then add a layoutSubViews and set a new frame;
-(void) viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
_chartView.frame = CGRectMake(20, 20, 500, 500);
}
Rotate the device and you'll see that the chart's frame does not take the new value.
from charts.
Yes, this finally fixed it. 👍
Thanks Daniel!
from charts.
Related Issues (20)
- Future of DGCharts? HOT 5
- Depreciated functions used in ChartColorTemplates HOT 1
- more colors with barchart HOT 1
- How to make stacked line chart?
- Creating Stacked Bar Chart How To Round Corner Radius Of Bar and How To Set DataPoints Background Color
- BarChart: highlight x-axis value when tapped HOT 1
- Incorrect scale of candlestick chart
- Y-axis max label is less than the highest Y-Value
- Library not loaded on physical device HOT 1
- crash animationUpdate() HOT 2
- Concurrency warning when conforming `ChartViewDelegate` with MainActor attribute.
- Pie chart update data set
- BalloonMarker Corner and barChart corner
- How to alpha background when select a marker ?
- How to alpha background when select a marker ? Now I use BalloonMarker
- Install pod 'DGCharts' & pod 'ChartsRealm' is the name of the libraries
- Install pod 'DGCharts' & pod 'ChartsRealm' is the name of the libraries, then i'm trying to build the application i'm getting below error:
- Install pod 'DGCharts' & pod 'ChartsRealm' is the name of the libraries, then i'm trying to build the application i'm getting errors: HOT 1
- Bar Chart Displaying Wrong Y Values JUST rightAxis,but leftAxis is OK!!! HOT 1
- Bar chart, x-axis or zero axis is overlapping the bars.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from charts.