Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4251806
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:42:38+00:00 2026-05-21T04:42:38+00:00

I have an array of integer values String[] values={3100,7500,8000,4200,88000,71000,32000}; that need to be scaled

  • 0

I have an array of integer values

String[] values={3100,7500,8000,4200,88000,71000,32000};

that need to be scaled into a known height of my JComponent , the question is how to scale these values into e.g. h=600px?

Here is a pic just for more clarification of what i want to achieve:
enter image description here

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:42:39+00:00Added an answer on May 21, 2026 at 4:42 am
    bar_height = chart_height*(value/max_value)

    To determine bar_height, you scale (multiply) chart_height by (value/max_value), where:

    • bar_height is the height of the a bar in pixels.
    • value is the value to be charted.
    • max_value is the maximum value on the y-axis.
    • chart_height is the height of the chart in pixels (600 in your example).

    For example:

    88000/88000 = 1.0, or 100% of the chart height        (600px)
        0/88000 = 0, or 0% of the chart's height          (  0px)
     3100/88000 = ~0.035, or ~3.53% of the chart's height (~21px)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array string[] with values that are mostly convertible to integers. var
I have an array of shorts (short[]) that I need to write out to
I have splitted comma separated values in an string array, something like this str[0]
I have an array containing all string values. Contents of the array are order_id,
i have a string array with values { 01.0, 01.4, 01.5, 0.20, 02.5, 02.6,
I have an array of numbers that potentially have up to 8 decimal places
I have an array of items that are time sensitive. After an amount of
I have an array of hashes, and I want the unique values out of
I have an array that looks like this when printed via NSLog: { response
When inserting a row in mysql database, string values need to be enclosed in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.