How to make the bar be a button?
Clash Royale CLAN TAG#URR8PPP
$begingroup$
This is a BarChart
:
BarChart[Tooltip[#, "I want tip"] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
I hope when I left-right the bar, then I copy the value into the clipboard. Is it possible?
charts interactive
$endgroup$
|
show 3 more comments
$begingroup$
This is a BarChart
:
BarChart[Tooltip[#, "I want tip"] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
I hope when I left-right the bar, then I copy the value into the clipboard. Is it possible?
charts interactive
$endgroup$
1
$begingroup$
how about clicking the bar:Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
?
$endgroup$
– kglr
Jan 24 at 4:23
$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want theButton
andTooltip
coexsit...
$endgroup$
– yode
Jan 24 at 4:29
$begingroup$
Tooltip is not removed. If the tooltips are removed in your version/os, you can useButton[Tooltip@#, CopyToClipboard[#]] &
as wrapper (You might want to add the optionPerformanceGoal -> "Quality"
if there are many bars in your chart).
$endgroup$
– kglr
Jan 24 at 4:32
$begingroup$
@kglr Do you meanBarChart[Button[Tooltip[#, "I want tip"], #] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
work for you? My version is 11.2..
$endgroup$
– yode
Jan 24 at 4:36
$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
Jan 24 at 4:42
|
show 3 more comments
$begingroup$
This is a BarChart
:
BarChart[Tooltip[#, "I want tip"] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
I hope when I left-right the bar, then I copy the value into the clipboard. Is it possible?
charts interactive
$endgroup$
This is a BarChart
:
BarChart[Tooltip[#, "I want tip"] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
I hope when I left-right the bar, then I copy the value into the clipboard. Is it possible?
charts interactive
charts interactive
edited Jan 24 at 15:07
gwr
8,46322761
8,46322761
asked Jan 24 at 4:08
yodeyode
10.3k234100
10.3k234100
1
$begingroup$
how about clicking the bar:Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
?
$endgroup$
– kglr
Jan 24 at 4:23
$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want theButton
andTooltip
coexsit...
$endgroup$
– yode
Jan 24 at 4:29
$begingroup$
Tooltip is not removed. If the tooltips are removed in your version/os, you can useButton[Tooltip@#, CopyToClipboard[#]] &
as wrapper (You might want to add the optionPerformanceGoal -> "Quality"
if there are many bars in your chart).
$endgroup$
– kglr
Jan 24 at 4:32
$begingroup$
@kglr Do you meanBarChart[Button[Tooltip[#, "I want tip"], #] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
work for you? My version is 11.2..
$endgroup$
– yode
Jan 24 at 4:36
$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
Jan 24 at 4:42
|
show 3 more comments
1
$begingroup$
how about clicking the bar:Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
?
$endgroup$
– kglr
Jan 24 at 4:23
$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want theButton
andTooltip
coexsit...
$endgroup$
– yode
Jan 24 at 4:29
$begingroup$
Tooltip is not removed. If the tooltips are removed in your version/os, you can useButton[Tooltip@#, CopyToClipboard[#]] &
as wrapper (You might want to add the optionPerformanceGoal -> "Quality"
if there are many bars in your chart).
$endgroup$
– kglr
Jan 24 at 4:32
$begingroup$
@kglr Do you meanBarChart[Button[Tooltip[#, "I want tip"], #] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
work for you? My version is 11.2..
$endgroup$
– yode
Jan 24 at 4:36
$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
Jan 24 at 4:42
1
1
$begingroup$
how about clicking the bar:
Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
?$endgroup$
– kglr
Jan 24 at 4:23
$begingroup$
how about clicking the bar:
Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
?$endgroup$
– kglr
Jan 24 at 4:23
$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want the
Button
and Tooltip
coexsit...$endgroup$
– yode
Jan 24 at 4:29
$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want the
Button
and Tooltip
coexsit...$endgroup$
– yode
Jan 24 at 4:29
$begingroup$
Tooltip is not removed. If the tooltips are removed in your version/os, you can use
Button[Tooltip@#, CopyToClipboard[#]] &
as wrapper (You might want to add the option PerformanceGoal -> "Quality"
if there are many bars in your chart).$endgroup$
– kglr
Jan 24 at 4:32
$begingroup$
Tooltip is not removed. If the tooltips are removed in your version/os, you can use
Button[Tooltip@#, CopyToClipboard[#]] &
as wrapper (You might want to add the option PerformanceGoal -> "Quality"
if there are many bars in your chart).$endgroup$
– kglr
Jan 24 at 4:32
$begingroup$
@kglr Do you mean
BarChart[Button[Tooltip[#, "I want tip"], #] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
work for you? My version is 11.2..$endgroup$
– yode
Jan 24 at 4:36
$begingroup$
@kglr Do you mean
BarChart[Button[Tooltip[#, "I want tip"], #] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
work for you? My version is 11.2..$endgroup$
– yode
Jan 24 at 4:36
$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
Jan 24 at 4:42
$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
Jan 24 at 4:42
|
show 3 more comments
2 Answers
2
active
oldest
votes
$begingroup$
You can wrap input data with Button
with action CopyToClipboard
:
data = 1, 2, 3;
BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
Update: You can add tool tips in several ways:
tooltips = "tooltip1", "tooltip2", "tooltip3";
- Use
Tooltip
as a wrapper on input data:
BarChart[Button[Tooltip@##, CopyToClipboard[#]] & @@@
Transpose[1, 2, 3, tooltips],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
- Use
Placed[tooltips, Tooltip]
as the setting for the optionChartLabels
:
BarChart[Button[#, CopyToClipboard[#]] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel",
ChartLabels -> Placed[tooltips, Tooltip]]
- Use a custom
ChartElementFunction
and pass the tooltips as metadata:
ceF[cedf_: "GlassRectangle"] := Button[Tooltip[ChartElementData[cedf][##], #3[[1]]],
BarChart[Thread[data -> tooltips], ChartElementFunction -> ceF,
ChartStyle -> "Pastel", PlotLabel -> (Paste)]
$endgroup$
add a comment |
$begingroup$
This is to get a slightly modified version of kglr's comments recorded as an answer. The modification is provide individual tooltips for each bar.
BarChart[
MapThread[
Button[Tooltip[#1, #2], CopyToClipboard@#1] &,
1, 2, 3, "left", "mid", "right"],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
.1
Also, be aware that if only want the tooltip to show the value of the bar, you don't need to specify Tooltip
; it will be supplied automatically.
BarChart[Button[#, CopyToClipboard@#] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
$endgroup$
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2fmathematica.stackexchange.com%2fquestions%2f190147%2fhow-to-make-the-bar-be-a-button%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can wrap input data with Button
with action CopyToClipboard
:
data = 1, 2, 3;
BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
Update: You can add tool tips in several ways:
tooltips = "tooltip1", "tooltip2", "tooltip3";
- Use
Tooltip
as a wrapper on input data:
BarChart[Button[Tooltip@##, CopyToClipboard[#]] & @@@
Transpose[1, 2, 3, tooltips],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
- Use
Placed[tooltips, Tooltip]
as the setting for the optionChartLabels
:
BarChart[Button[#, CopyToClipboard[#]] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel",
ChartLabels -> Placed[tooltips, Tooltip]]
- Use a custom
ChartElementFunction
and pass the tooltips as metadata:
ceF[cedf_: "GlassRectangle"] := Button[Tooltip[ChartElementData[cedf][##], #3[[1]]],
BarChart[Thread[data -> tooltips], ChartElementFunction -> ceF,
ChartStyle -> "Pastel", PlotLabel -> (Paste)]
$endgroup$
add a comment |
$begingroup$
You can wrap input data with Button
with action CopyToClipboard
:
data = 1, 2, 3;
BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
Update: You can add tool tips in several ways:
tooltips = "tooltip1", "tooltip2", "tooltip3";
- Use
Tooltip
as a wrapper on input data:
BarChart[Button[Tooltip@##, CopyToClipboard[#]] & @@@
Transpose[1, 2, 3, tooltips],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
- Use
Placed[tooltips, Tooltip]
as the setting for the optionChartLabels
:
BarChart[Button[#, CopyToClipboard[#]] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel",
ChartLabels -> Placed[tooltips, Tooltip]]
- Use a custom
ChartElementFunction
and pass the tooltips as metadata:
ceF[cedf_: "GlassRectangle"] := Button[Tooltip[ChartElementData[cedf][##], #3[[1]]],
BarChart[Thread[data -> tooltips], ChartElementFunction -> ceF,
ChartStyle -> "Pastel", PlotLabel -> (Paste)]
$endgroup$
add a comment |
$begingroup$
You can wrap input data with Button
with action CopyToClipboard
:
data = 1, 2, 3;
BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
Update: You can add tool tips in several ways:
tooltips = "tooltip1", "tooltip2", "tooltip3";
- Use
Tooltip
as a wrapper on input data:
BarChart[Button[Tooltip@##, CopyToClipboard[#]] & @@@
Transpose[1, 2, 3, tooltips],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
- Use
Placed[tooltips, Tooltip]
as the setting for the optionChartLabels
:
BarChart[Button[#, CopyToClipboard[#]] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel",
ChartLabels -> Placed[tooltips, Tooltip]]
- Use a custom
ChartElementFunction
and pass the tooltips as metadata:
ceF[cedf_: "GlassRectangle"] := Button[Tooltip[ChartElementData[cedf][##], #3[[1]]],
BarChart[Thread[data -> tooltips], ChartElementFunction -> ceF,
ChartStyle -> "Pastel", PlotLabel -> (Paste)]
$endgroup$
You can wrap input data with Button
with action CopyToClipboard
:
data = 1, 2, 3;
BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
Update: You can add tool tips in several ways:
tooltips = "tooltip1", "tooltip2", "tooltip3";
- Use
Tooltip
as a wrapper on input data:
BarChart[Button[Tooltip@##, CopyToClipboard[#]] & @@@
Transpose[1, 2, 3, tooltips],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
- Use
Placed[tooltips, Tooltip]
as the setting for the optionChartLabels
:
BarChart[Button[#, CopyToClipboard[#]] & /@ data,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel",
ChartLabels -> Placed[tooltips, Tooltip]]
- Use a custom
ChartElementFunction
and pass the tooltips as metadata:
ceF[cedf_: "GlassRectangle"] := Button[Tooltip[ChartElementData[cedf][##], #3[[1]]],
BarChart[Thread[data -> tooltips], ChartElementFunction -> ceF,
ChartStyle -> "Pastel", PlotLabel -> (Paste)]
edited Jan 25 at 20:09
answered Jan 24 at 5:21
kglrkglr
183k10201416
183k10201416
add a comment |
add a comment |
$begingroup$
This is to get a slightly modified version of kglr's comments recorded as an answer. The modification is provide individual tooltips for each bar.
BarChart[
MapThread[
Button[Tooltip[#1, #2], CopyToClipboard@#1] &,
1, 2, 3, "left", "mid", "right"],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
.1
Also, be aware that if only want the tooltip to show the value of the bar, you don't need to specify Tooltip
; it will be supplied automatically.
BarChart[Button[#, CopyToClipboard@#] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
$endgroup$
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
add a comment |
$begingroup$
This is to get a slightly modified version of kglr's comments recorded as an answer. The modification is provide individual tooltips for each bar.
BarChart[
MapThread[
Button[Tooltip[#1, #2], CopyToClipboard@#1] &,
1, 2, 3, "left", "mid", "right"],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
.1
Also, be aware that if only want the tooltip to show the value of the bar, you don't need to specify Tooltip
; it will be supplied automatically.
BarChart[Button[#, CopyToClipboard@#] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
$endgroup$
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
add a comment |
$begingroup$
This is to get a slightly modified version of kglr's comments recorded as an answer. The modification is provide individual tooltips for each bar.
BarChart[
MapThread[
Button[Tooltip[#1, #2], CopyToClipboard@#1] &,
1, 2, 3, "left", "mid", "right"],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
.1
Also, be aware that if only want the tooltip to show the value of the bar, you don't need to specify Tooltip
; it will be supplied automatically.
BarChart[Button[#, CopyToClipboard@#] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
$endgroup$
This is to get a slightly modified version of kglr's comments recorded as an answer. The modification is provide individual tooltips for each bar.
BarChart[
MapThread[
Button[Tooltip[#1, #2], CopyToClipboard@#1] &,
1, 2, 3, "left", "mid", "right"],
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
.1
Also, be aware that if only want the tooltip to show the value of the bar, you don't need to specify Tooltip
; it will be supplied automatically.
BarChart[Button[#, CopyToClipboard@#] & /@ 1, 2, 3,
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
answered Jan 24 at 5:35
community wiki
m_goldberg
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
add a comment |
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
$begingroup$
Thanks very much..:)
$endgroup$
– yode
Jan 25 at 3:56
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- 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.
Use MathJax to format equations. MathJax reference.
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%2fmathematica.stackexchange.com%2fquestions%2f190147%2fhow-to-make-the-bar-be-a-button%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
1
$begingroup$
how about clicking the bar:
Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
?$endgroup$
– kglr
Jan 24 at 4:23
$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want the
Button
andTooltip
coexsit...$endgroup$
– yode
Jan 24 at 4:29
$begingroup$
Tooltip is not removed. If the tooltips are removed in your version/os, you can use
Button[Tooltip@#, CopyToClipboard[#]] &
as wrapper (You might want to add the optionPerformanceGoal -> "Quality"
if there are many bars in your chart).$endgroup$
– kglr
Jan 24 at 4:32
$begingroup$
@kglr Do you mean
BarChart[Button[Tooltip[#, "I want tip"], #] & /@ 1, 2, 3, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]
work for you? My version is 11.2..$endgroup$
– yode
Jan 24 at 4:36
$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
Jan 24 at 4:42