How to make the bar be a button?












4












$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?










share|improve this question











$endgroup$








  • 1




    $begingroup$
    how about clicking the bar: Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ {1, 2, 3}, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]?
    $endgroup$
    – kglr
    4 hours ago












  • $begingroup$
    @kglr I'm sorry I make a little tuning in the origin question. Actually I want the Button and Tooltip coexsit...
    $endgroup$
    – yode
    4 hours ago










  • $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
    4 hours ago










  • $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
    4 hours ago












  • $begingroup$
    @kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
    $endgroup$
    – yode
    4 hours ago


















4












$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?










share|improve this question











$endgroup$








  • 1




    $begingroup$
    how about clicking the bar: Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ {1, 2, 3}, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]?
    $endgroup$
    – kglr
    4 hours ago












  • $begingroup$
    @kglr I'm sorry I make a little tuning in the origin question. Actually I want the Button and Tooltip coexsit...
    $endgroup$
    – yode
    4 hours ago










  • $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
    4 hours ago










  • $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
    4 hours ago












  • $begingroup$
    @kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
    $endgroup$
    – yode
    4 hours ago
















4












4








4





$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?










share|improve this question











$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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago







yode

















asked 4 hours ago









yodeyode

10.2k234100




10.2k234100








  • 1




    $begingroup$
    how about clicking the bar: Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ {1, 2, 3}, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]?
    $endgroup$
    – kglr
    4 hours ago












  • $begingroup$
    @kglr I'm sorry I make a little tuning in the origin question. Actually I want the Button and Tooltip coexsit...
    $endgroup$
    – yode
    4 hours ago










  • $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
    4 hours ago










  • $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
    4 hours ago












  • $begingroup$
    @kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
    $endgroup$
    – yode
    4 hours ago
















  • 1




    $begingroup$
    how about clicking the bar: Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ {1, 2, 3}, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]?
    $endgroup$
    – kglr
    4 hours ago












  • $begingroup$
    @kglr I'm sorry I make a little tuning in the origin question. Actually I want the Button and Tooltip coexsit...
    $endgroup$
    – yode
    4 hours ago










  • $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
    4 hours ago










  • $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
    4 hours ago












  • $begingroup$
    @kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
    $endgroup$
    – yode
    4 hours ago










1




1




$begingroup$
how about clicking the bar: Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ {1, 2, 3}, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]?
$endgroup$
– kglr
4 hours ago






$begingroup$
how about clicking the bar: Deploy@BarChart[Button[#, CopyToClipboard[#]] & /@ {1, 2, 3}, ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]?
$endgroup$
– kglr
4 hours ago














$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want the Button and Tooltip coexsit...
$endgroup$
– yode
4 hours ago




$begingroup$
@kglr I'm sorry I make a little tuning in the origin question. Actually I want the Button and Tooltip coexsit...
$endgroup$
– yode
4 hours ago












$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
4 hours ago




$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
4 hours ago












$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
4 hours ago






$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
4 hours ago














$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
4 hours ago






$begingroup$
@kglr The code can draw the bar graphics here, but it cannot copy the value into the clipboard. Please check....
$endgroup$
– yode
4 hours ago












2 Answers
2






active

oldest

votes


















4












$begingroup$

You can wrap input data with Button with action CopyToClipboard:



BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ {1, 2, 3}, 
ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]





share|improve this answer









$endgroup$





















    0












    $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"]


    chart.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"]


    chart.2






    share|improve this answer











    $endgroup$













      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
      });


      }
      });














      draft saved

      draft discarded


















      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









      4












      $begingroup$

      You can wrap input data with Button with action CopyToClipboard:



      BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ {1, 2, 3}, 
      ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]





      share|improve this answer









      $endgroup$


















        4












        $begingroup$

        You can wrap input data with Button with action CopyToClipboard:



        BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ {1, 2, 3}, 
        ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]





        share|improve this answer









        $endgroup$
















          4












          4








          4





          $begingroup$

          You can wrap input data with Button with action CopyToClipboard:



          BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ {1, 2, 3}, 
          ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]





          share|improve this answer









          $endgroup$



          You can wrap input data with Button with action CopyToClipboard:



          BarChart[Button[Tooltip[#, "I want tip"], CopyToClipboard@#] & /@ {1, 2, 3}, 
          ChartElementFunction -> "GlassRectangle", ChartStyle -> "Pastel"]






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          kglrkglr

          180k9200413




          180k9200413























              0












              $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"]


              chart.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"]


              chart.2






              share|improve this answer











              $endgroup$


















                0












                $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"]


                chart.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"]


                chart.2






                share|improve this answer











                $endgroup$
















                  0












                  0








                  0





                  $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"]


                  chart.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"]


                  chart.2






                  share|improve this answer











                  $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"]


                  chart.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"]


                  chart.2







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  answered 3 hours ago


























                  community wiki





                  m_goldberg































                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      SQL Server 17 - Attemping to backup to remote NAS but Access is denied

                      Always On Availability groups resolving state after failover - Remote harden of transaction...

                      Restoring from pg_dump with foreign key constraints