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

  • SEARCH
  • Home
  • 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 8734045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:46:01+00:00 2026-06-13T09:46:01+00:00

My application generates a set of graph points to be drawn in SVG. The

  • 0

My application generates a set of graph points to be drawn in SVG. The point values are always in the range of 0-1000 horizontally and vertically. The size of the rectangle where the drawing takes place might change.

here is the SVG element to draw the graph on a 200 X 85 rect:

<svg width="200" height="85" viewBox="0 0 1000 1000" preserveAspectRatio="none">
    <polyline  stroke="#e69800"
               stroke-width="2px"
               fill="none"
               points="0,1000 100,900 200,800
                       300,700 400,600 500,500
                       600 400 700,300 800,200900,100 1000,0"/>
</svg>

Setting viewBox="0 0 1000 1000" makes the graph shrink to the proper size, the problem is that this also shrinks the width of the line in the same proportion, so the line is not visible any more.

SVG seems to ignore the “px” in the attribute stroke-width="2px".

Is there a way to specify the width of the line (stroke-width) in absolute pixel size?

  • 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-06-13T09:46:02+00:00Added an answer on June 13, 2026 at 9:46 am

    You can use the attribute vector-effect="non-scaling-stroke" to prevent the line from scaling with the rest.

    Ref: http://www.w3.org/TR/SVGTiny12/painting.html#NonScalingStroke

    The resulting visual effect of this modification is that stroke width
    is not dependant on the transformations of the element (including
    non-uniform scaling and shear transformations) and zoom level

    It seems that SVG1.1 doesn’t support non-scaling stroke though, so the final result might depend on the rendering engine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application that generates graphs. I need to set the bar
I'm using a custom-built inhouse application that generates a standard set of reports on
I'm working on an application that generates a set of bitmaps and then loads
My application generates binary data (compressed xml) and saves it to the Google App
My Java Swing application generates an HTML file, and I want to open it
I have a some of html strings that my application generates. Each html 'snippet'
I wrote an application that generates quiz applets. I could't find a portable way
I have an application that generates barcode in image format and it is read
I have a application that generates a couple of different mails. These mails are
I have an application that generates around 10000 printed pages per month. Each report

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.