Canvas - scale part of the chartCapture HTML Canvas as gif/jpg/png/pdf?Resize HTML5 canvas to fit windowHow to clear the canvas for redrawingUsing HTML5/Canvas/JavaScript to take in-browser screenshotsAuto Scale TextView Text to Fit within BoundsAndroid GLSurfaceView pinch to zoomEditText scale with selectionHow do I get onTouch events to draw correctly on a zoomable imageview with canvas?Drawing a rectangle behind custom ImageView not animatingZoom in on point in canvas, where everything is based off of a certain point
Two researchers want to work on the same extension to my paper. Who to help?
Are there variations of the regular runtimes of the Big-O-Notation?
What are the components of a legend (in the sense of a tale, not a figure legend)?
Why do Thanos's punches not kill Captain America or at least cause some mortal injuries?
Plastic-on-plastic lubricant that wont leave a residue?
Extrude the faces of a cube symmetrically along XYZ
What is Plautus’s pun about frustum and frustrum?
Early arrival in Australia, early hotel check in not available
Page contents aligning weirdly in LaTeX/Overleaf
Why did the ICC decide not to probe alleged US atrocities in Afghanistan?
How can a Lich look like a human without magic?
Why can't RGB or bicolour LEDs produce a decent yellow?
Why in a Ethernet LAN, a packet sniffer can obtain all packets sent over the LAN?
Anatomically Correct Carnivorous Tree
What does "Ich wusste, dass aus dir mal was wird" mean?
How does Howard Stark know this?
Is the schwa sound consistent?
Why does getw return -1 when trying to read a character?
Why was castling bad for white in this game, and engine strongly prefered trading queens?
Size of a folder with du
What is the significance of 4200 BCE in context of farming replacing foraging in Europe?
Was there ever any real use for a 6800-based Apple I?
How does noise-cancellation work in Mac laptops?
Was this character’s old age look CGI or make-up?
Canvas - scale part of the chart
Capture HTML Canvas as gif/jpg/png/pdf?Resize HTML5 canvas to fit windowHow to clear the canvas for redrawingUsing HTML5/Canvas/JavaScript to take in-browser screenshotsAuto Scale TextView Text to Fit within BoundsAndroid GLSurfaceView pinch to zoomEditText scale with selectionHow do I get onTouch events to draw correctly on a zoomable imageview with canvas?Drawing a rectangle behind custom ImageView not animatingZoom in on point in canvas, where everything is based off of a certain point
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a line chart and a "window" that helps to choose part of the chart to be enlarged by another fragment. Here's what it looks like:
The upper half of screen is intended for the redrawed scaled part of chart from semi-transparent pink window. The "window" itself is a shape described in .xml
file. I can drag this shape and in onTouch(View v, MotionEvent event)
receive position in pxs of left/right borders. The chart itself is a custom view drawn with drawLines(float[] values, Paint p)
.
I'm trying to figure out how to infer from which and to which index of float[] values
to redraw a scaled chart.
P.S.
I also want to be able to scroll scaled part left and right and zoom with pinch, but that is probably out of the scope of this question.
UPD:
I explained how it can probably be solved in comments
java android canvas
add a comment |
I have a line chart and a "window" that helps to choose part of the chart to be enlarged by another fragment. Here's what it looks like:
The upper half of screen is intended for the redrawed scaled part of chart from semi-transparent pink window. The "window" itself is a shape described in .xml
file. I can drag this shape and in onTouch(View v, MotionEvent event)
receive position in pxs of left/right borders. The chart itself is a custom view drawn with drawLines(float[] values, Paint p)
.
I'm trying to figure out how to infer from which and to which index of float[] values
to redraw a scaled chart.
P.S.
I also want to be able to scroll scaled part left and right and zoom with pinch, but that is probably out of the scope of this question.
UPD:
I explained how it can probably be solved in comments
java android canvas
Before invokingdrawLines()
I scale my array of points. When moving a "window" shape I can get its left and right position in pixels. Now, I probably want to convert them in original points using the same scale factor. Though, this method will only give me x points and there's no way to get y's. Can I tweak this approach somehow ?
– pushandpop
Mar 23 at 12:04
add a comment |
I have a line chart and a "window" that helps to choose part of the chart to be enlarged by another fragment. Here's what it looks like:
The upper half of screen is intended for the redrawed scaled part of chart from semi-transparent pink window. The "window" itself is a shape described in .xml
file. I can drag this shape and in onTouch(View v, MotionEvent event)
receive position in pxs of left/right borders. The chart itself is a custom view drawn with drawLines(float[] values, Paint p)
.
I'm trying to figure out how to infer from which and to which index of float[] values
to redraw a scaled chart.
P.S.
I also want to be able to scroll scaled part left and right and zoom with pinch, but that is probably out of the scope of this question.
UPD:
I explained how it can probably be solved in comments
java android canvas
I have a line chart and a "window" that helps to choose part of the chart to be enlarged by another fragment. Here's what it looks like:
The upper half of screen is intended for the redrawed scaled part of chart from semi-transparent pink window. The "window" itself is a shape described in .xml
file. I can drag this shape and in onTouch(View v, MotionEvent event)
receive position in pxs of left/right borders. The chart itself is a custom view drawn with drawLines(float[] values, Paint p)
.
I'm trying to figure out how to infer from which and to which index of float[] values
to redraw a scaled chart.
P.S.
I also want to be able to scroll scaled part left and right and zoom with pinch, but that is probably out of the scope of this question.
UPD:
I explained how it can probably be solved in comments
java android canvas
java android canvas
edited Mar 23 at 11:58
pushandpop
asked Mar 22 at 20:09
pushandpoppushandpop
229718
229718
Before invokingdrawLines()
I scale my array of points. When moving a "window" shape I can get its left and right position in pixels. Now, I probably want to convert them in original points using the same scale factor. Though, this method will only give me x points and there's no way to get y's. Can I tweak this approach somehow ?
– pushandpop
Mar 23 at 12:04
add a comment |
Before invokingdrawLines()
I scale my array of points. When moving a "window" shape I can get its left and right position in pixels. Now, I probably want to convert them in original points using the same scale factor. Though, this method will only give me x points and there's no way to get y's. Can I tweak this approach somehow ?
– pushandpop
Mar 23 at 12:04
Before invoking
drawLines()
I scale my array of points. When moving a "window" shape I can get its left and right position in pixels. Now, I probably want to convert them in original points using the same scale factor. Though, this method will only give me x points and there's no way to get y's. Can I tweak this approach somehow ?– pushandpop
Mar 23 at 12:04
Before invoking
drawLines()
I scale my array of points. When moving a "window" shape I can get its left and right position in pixels. Now, I probably want to convert them in original points using the same scale factor. Though, this method will only give me x points and there's no way to get y's. Can I tweak this approach somehow ?– pushandpop
Mar 23 at 12:04
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307135%2fcanvas-scale-part-of-the-chart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307135%2fcanvas-scale-part-of-the-chart%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Before invoking
drawLines()
I scale my array of points. When moving a "window" shape I can get its left and right position in pixels. Now, I probably want to convert them in original points using the same scale factor. Though, this method will only give me x points and there's no way to get y's. Can I tweak this approach somehow ?– pushandpop
Mar 23 at 12:04